If you use your Mac in a place where multiple known WiFi networks are available, it can be helpful to control which WiFi network your Mac will prefer and join first. Follow these steps to configure the priority of known WiFi networks.
Open System Preferences and choose the Network preference pane.
Once in the network pane, choose Wi-Fi in the network services list.
Click the "Advanced..." button in the bottom right corner.
In the "Preferred Networks" list, drag WiFi networks up or down to put them in the order in which your Mac should search and join networks.
If there are networks which you no longer need, you can delete them with the "-" button.
If you want to keep a network in place, but your Mac should not search and join that network automatically, deselect the "Auto-Join" checkbox next to the WiFi network name.