Firewalls and antivirus software are two common methods used to protect computers and networks from unauthorized access and malware. Firewalls control access between private networks and the public internet, while antivirus software detects and removes viruses and other malicious software. Antivirus software uses techniques like signature-based detection to identify known malware, and heuristic analysis to detect potential threats. However, no security measures are perfect, so educating users on threats like phishing, spyware and hackers remains important.