1) You downloaded an executable or zipped file that contains a virus or spyware
2) You had been hacked by comeone on the internet and they installed the virus on your system.
Typically the reason why you got the virus is because of reason number 1.
Always look at the file you are downloading and make sure it is safe by going to http://safeweb.norton.com/ and entering the website name. If it is safe then go ahead and download what you want.
Always be suspicous of .exe files (Executable) or .zip, .rar, or .tar files.
I will post more ti[ps later, have a great day!
Questions or comments? Contact me anytime @Worldtechguru on Twitter.