System preferences > Network >
Make sure Airport is at the top of the list of connections. If not, use the Gear Icon to Set Order and drag it to the top.
Once it is at the top, select it.
If it does not say ON and connected, turn it off and back on again ONCE to correct for random glitches. (This is not a fix.)
If this is the same setup you always use, and it is not working now, use ( Assist me ) button and choose Diagnostics. Follow the directions. By far the best FIX it will suggest is to power off your Router for a quarter minute. When it comes back on, it may move to a less-crowded channel. (so do not just ignore that suggestion, really do it if suggested.)
If no joy, Use the ( Assist Me ) button and Use Setup Assistant to set up from scratch, including a new "Location".
If no joy, review the list of acceptable networks to join. Reduce the list to only your Home Network. and [√] Ask to join new Networks (do not join others [such as your neighbors] automatically).
Use a different "Location" for when you go to Starbucks, a different one for School, a different one for Work. Thats what "Locations" are all about. Each one can have different attributes, especially what Networks to join, so that your Mac does not wander off onto a different network, or hop from network to network, with unintended consequences.