Nine or ten years ago, if you mentioned a firewall to someone they probably would not know what you where talking about. These days most people have heard of firewalls but a lot of people do not actually know what they do. Some people also assume that the firewall that comes with their operating system is adequate to protect them from trojans, hackers and viruses. They could not be further from the truth.
Even a good firewall is not a virus scanner and relying on a firewall only will not offer you total protection. In the same way that relying on a good anti virus program will not protect you from hackers like a firewall can.
A firewall’s job is to monitor all incoming and out going data and to block any malicous data coming in or going out. Think of it as a immigration officer at a airport. The final say on who comes into the country is based on the rules of that country. The same applies to firewalls, you make a set of rules and the firewall obeys the rules allowing and disallowing data in and out.
A good firewall will automatically block incoming connection or program connecting out it does not have a rule for.