A firewall sits at the network “entrance” and filters traffic by predefined rules: for example, it blocks unknown connections from outside and limits access between parts of the internal network.
It can be a dedicated device or a router feature. A firewall does not replace antivirus or updates, but it is one of the core layers of protection.
Example
A firewall rule stops the camera network from reaching the internet — the recorder can only be reached over VPN.