A firewall acts as a block to prevent someone or something from invading your computer. Some firewalls also prevent your computer from sending things that you did not intend to send.
There are two kinds of firewalls: Software and Hardware. Hardware firewalls usually exist in the router that may be connected between the modem or device that connects you to your Internet service provider (ISP) and your computer. Most newer ISP-provided modems now come with a built-in wireless router. All Windows versions include a software firewall. The later versions of Windows (Vista and 7) have more effective firewalls than XP.
There are also software offerings that you can buy that purport to be better yet. An example is Zone Alarm. However, you should know that software firewalls can cause problems that are very mysterious and hard to diagnose. My recommendation is that you do NOT use any firewall other than the one that is part of Windows. “Internet Protection” suites offered by Norton, McAfee and the like include their own versions of firewalls and by default shut down your Windows firewall. I do NOT recommend you allow those systems to do that. In fact, I do NOT recommend any Internet Protection suite.