A firewall may be in the form of software or hardware. It protects the computer against vulnerabilities, or holes in the operating system’s security. As the lowest form, but pretty effective measure, you may use a software firewall, such as Zone Alarm. The software firewall filters out hackers and potential threats and allows good information to flow through.
A hardware firewall is usually found in companies to protect servers from being attacked at the network level. This, in turn, protects workstations in the network environment as well.
In general, it is wise to at least have a software firewall present on computers. Windows now comes with its on internal firewall which is sufficient. Macs do not come with firewall software so this should be installed although Macs are not prime targets for attacks like PCs.