A "firewall" works to prevent a "hacker" or a hacker's program, from getting into your computer through your Internet connection. If a hacker gains access to your computer, they can put a virus in your computer, or have your computer send them your personal information, or any other information in your computer, through the Internet.
There are two types of firewalls, "software" and "hardware."
A "software" firewall is a program that you install on your computer. It comes on a CD. It monitors your Internet connection. When it sees any suspicious activity, it warns you and asks you if it should "allow it" or "block it."
A "hardware" firewall is a device that you put between your modem and your computer. It monitors the information going from and to your computer, and it blocks incoming information it "thinks" you didn't request.
Hardware firewalls are generally believed to work better. For beginners, they also offer the advantage of not asking a lot of questions, that you may not know the answer to.
If you are using any form of "high speed" Internet, you should have a firewall. If you are using non-high speed Internet (usually this is called "dial-up" and it ties up your phone line while you are using it), it is still a good idea to have a firewall (but because dial-up Internet is much slower, it would take a hacker much longer to break into your computer, so the risk is a little lower here).