Antivirus (or anti-virus) software is used to safeguard a computer from malware, including viruses, computer worms, and Trojan horses. Antivirus software may also remove or prevent spyware and adware, along with other forms of malicious programs. Free antivirus software generally only searches your computer using signature-based detection which involves looking for patterns of data that are known to be related to already-identified malware. Paid antivirus software will usually also include heuristics to catch new, or zero-day threats, by either using genetic signatures to identify new variants of existing virus code or by running the file in a virtual environment (also called a sandbox), and watching what it does to see if it has malicious intent.
Virus designers, however, usually test their malicious code against the major antivirus types of malware, specifically ransomware, use polymorphic code to make it difficult to be detected by antivirus software. Besides using antivirus software to keep your computer safe and running smoothly, it is also always a good idea to be proactive: make sure your web browser is updated to the latest version, use a firewall, only download programs from websites you trust and always surf the web using a standard user account, rather than your administrator one.