If your Mac is having trouble connecting to Wi-Fi, you may need to forget the wireless network and then re-add it. Here's a quick guide on how to do that:
- Click the Apple icon in the menu bar
- Select System Settings
- Under System Settings, select Wi-Fi
- Click on the three dots next to the network you wish to forget
- Select Forget This Network
Once you've forgotten the network, you may need to wait a few moments for the network to re-appear; once it does, you can connect again.