You’ll find your Mac’s firewall in the Security and Privacy preference in the System Preferences app.
To start using the firewall, once you’ve entered your password, all you need to do is click the button that says Turn On Firewall
Depending on what applications you have running and which sharing services you have turned on, what you’ll see when you look at Firewall Options may be a little different than what you see in the following screenshot:
If you selected File Sharing in the Sharing preference you should now see File Sharing (AFP, SMB) in the list of allowed applications.