Turn On Stealth Mode
One feature of OS X's Firewall is Stealth Mode, which prevents other users from seeing your Mac on the network that you're connected to. This is a great feature to have enabled if you constantly use public WiFi connections.
To enable it, you'll first need to enable the Firewall by going into System Preferences and clicking on Security & Privacy. From there, click on the Firewall tab, enable it, and then click on Firewall Options. In the pop-up window, place a checkmark next to Stealth Mode.