Firewall is software or hardware that will protect the computer when you surf in internet. It will block the unauthorized access to your computer.
Firewall will monitor the Incoming connection as well as outgoing connection. It is a wall between your computer and internet.
Firewall gives control over your computer network. You can customize the firewall for your needs. You can apply rules for each filter. You can apply firewall for HTTP, TCP, FTP, SMTP, Telnet, IP and many more.
If you want to block the FTP, you can block the port 21, which will be used FTP to transfer the data between 2 machines. Firewall will work based on the rules set defined. If you want to block certain sites or certain files types that cannot be downloaded can be set in Firewall.