A firewall primarily controls network traffic by filtering and allowing/blocking data packets based on predefined rules. An antivirus, on the other hand, focuses on detecting and removing malware, viruses, and other malicious software from your computer or device. While firewalls protect the network, antiviruses protect against specific threats at the system level.