A firewall is a security system that acts as a barrier between your device or network and the internet.
It watches all incoming and outgoing network traffic and decides which data is allowed through and which should be blocked based on a set of security rules.