A Mac remembers every Wi-Fi network it has joined, including ones I’d rather it never picked by itself: the slow guest network next to the good one, or the hotspot of a café you visited once. You don’t have to forget them to stop that.
System Settings > Wi-Fi > Known Networks > (…) > Auto-Join
In the Known Networks list, click the More button next to a network and untick Auto-Join. The network stays saved with its password, so you can still connect with one click when you actually want it. For the network you’re on right now, the same switch is called Automatically join this network, under Details.
When a network really has to go, choose Forget This Network in that same menu. From the Terminal you can see the saved list and remove an entry:
networksetup -listpreferredwirelessnetworks en0
networksetup -removepreferredwirelessnetwork en0 "Old Guest Wi-Fi"
Use the Wi-Fi interface name (often en0 on a MacBook) and the network name exactly as the first command prints it, in quotes when it has spaces. Apple’s man page says networksetup needs admin rights to change network settings, so put sudo in front if the second command refuses.
My advice is to switch off Auto-Join for anything you only need now and then, and keep the list short. A related setting lives on the main Wi-Fi page: Ask to join hotspots decides whether your Mac jumps onto an iPhone Personal Hotspot when no known network is around (Never, Ask to Join or Automatic). The caveat with forgetting: on macOS Sequoia 15 and later the Mac also forgets the private Wi-Fi address it used for that network, so if your router has a reservation for it, expect a new address when you rejoin.
Further reading: Wi-Fi settings on Mac (Apple), networksetup man page (SS64, macOS)