There are countless new viruses and malware released everyday, and hackers are inventing new ones all the time. The most common ways to get infected are to download files from untrustworthy sites, clicking on malicious links, or opening affected email attachments. Sometimes you did nothing wrong but the virus/malware took advantage of a vulnerability in some installed software or OS.