The only way to be 100% protected from viruses, and malware is to not be connected to the internet at all, ever, and don't let your friends use their CDs, and flash drives on your computer. If you can't do that, well, check the sender of each email you get before opening it, stay away from free streaming sites, sites with pirated software and keys, file hosting sites, image sites, torrents, P2P programs, and don't install Java.
Sucks a little doesn't it? :P. You should ALWAYS keep an anti-virus installed, and have 24/7 protection on always for you (never more than one... otherwise conflicts can arise), and have an anti-malware scanner as well.
Avast anti-virus, Malwarebytes, and Spybot are some of the ones I use. Other more advanced ones I use are rKill (kills any suspicious tasks that prevent anti virus stuff from running), tdsskiller.. which gets rid of any nasty deep root-kits, and ComboFix.. which is pretty much a last resort, but very effective at cleaning up everything.. a little risky sometimes though.