It is software or hardware that blocks incoming or outgoing traffic from the internet to your computer. They are responsible for securing a network. A few common types of firewalls are:
Packet-filtering Firewalls: These are the most common type of firewalls that analyze packets and let them pass through only if they match an established security rule-set.
Proxy Firewalls: They filter network traffic at the application level.
Stateful Multilayer Inspection (SMLI) Firewalls: These filter packets at the network, transport, and application layers. Here, the packets are compared to the known trusted packets.