Antivirus software works by scanning files and programs on a device against a database of known threats. It uses signature-based detection and heuristic analysis to identify and neutralize threats. Regular updates to the software ensure it can detect the latest malware.