Macs automatically remember all the Wi-Fi networks you've ever connected to, along with their passwords. If you're having trouble connecting to Wi-Fi, you can remove one from the list of networks to fix your problem.

If there's a network you've previously connected to that no longer works, deleting and reconnecting is a good way to try to troubleshoot any issues. Whether you want to remove a "failed" network or delete a Wi-Fi network that's been stored in macOS for years, you can do so from the Network preferences of your Mac.
First, open System Preferences. To do this, click on the “Apple” icon in the top left of the menu bar and select “System Preferences.”.

From the “System Preferences” menu, click on the “Network” option.

Make sure you have “Wi-Fi” selected on the left side of the window and click the “Advanced” button at the bottom of the window to display more options.

Click on the network you want to delete to highlight it. If you want to delete multiple networks, Command+Click on each one. Click the “-” button to delete the networks.

Click “Remove” in the pop-up window to remove the networks. If you selected more than one, you can select “Apply To All” to avoid seeing this pop-up window multiple times.

If you want to avoid saving Wi-Fi networks in the future, you can uncheck the box next to “Remember Networks This Computer Has Joined.”

When you're done, click the “OK” button at the bottom right.

Finally, click the “Apply” button to apply the changes.

You can now close the System Preferences window. The next time you connect to a deleted network, you'll have to manually select it in your Mac's Wi-Fi menu and you'll also have to retype the password.
Information source: howtogeek.com
