Had similar problems
Although I was trying to connect to my own WiFi network, he adds hastily.
If the previous advice doesn't help, a couple of other things;
Top right edge of your screen, maybe two or three small icons to the right of your webcam location, there will be a small icon made up of four curved bars stacked vertically. If you click on that it will tell you if you have switched your WiFi off by accident ( always check the easy stuff first )
Still no luck? Then go to the top left corner of your screen and click on;
the Apple logo
then ABOUT THIS MAC
then MORE INFO
then SYSTEM REPORT
then WiFi
.... if you do that you can see what WiFi activity your computer can see. It might be that there is some sort of address or channel conflict, and finding that out will help. You might want to copy that WiFi information and post it into a message here in case someone here can tell you what's wrong.
Gordon