When you're carrying around a laptop looking for a network connection, most of the networks you encounter are basically plug-and-play: they use DHCP to issue an IP address and dynamically manage what clients are on the network, and when a connection is established, OS X will automatically configure it.
This works well in most settings, but sometimes a network will have specific configuration requirements such as manual IP address assignment, multicasting setups that isolate logical networks over the same hardware, or authentication schemes that have special hardware requirements.
In these instances, while you can continually access your network settings and adjust them accordingly, an easier solution is to configure a new network location for OS X that you can quickly switch to when needed.
To set up a network location, go to the Apple menu, then the Location submenu, and choose Network Preferences. In these preferences you will see a Location menu where the default setting is Automatic. This default Location has all available hardware ports set up to automatically pick up IP addresses through DHCP.
While you can adjust these port settings to your needs, you can create an entire new set of configurations for these ports by creating a new location. Click the Location menu and choose Edit Locations, from which you can duplicate or create an existing network port configuration or create one from scratch.
By default a new network port configuration will contain entries for your local hardware ports (in other words, one for FireWire, Ethernet, Wi-Fi, and Bluetooth if you have those adapters in your system). You will see these listed in the port list to the left of the Network system preferences, and for this new Location you can add or remove them by clicking the plus or minus buttons under the list.
Removing ports will ensure that they do not get configured when you have this specific location set, which can help increase security. For example, if your workplace has an unsecured Wi-Fi network for guests but has a secured Ethernet network, then you can prevent the system from connecting to the Wi-Fi network at your work by removing it from the Location you've configured to use there.
Once you have the appropriate ports set up for your Location, configure each according to its network requirements, which includes IP addresses and authentication routines, DNS servers, and proxies, among other details. You can also configure specific VPN connections to be only available for this network location.
When the Location is set up and working, you can then switch to it easily by going to the Apple menu and choosing it from the Location menu.