- Use a safe browser. Google Chrome or Firefox
- Enable "click to play" for plugins (Flash and Java primarily)
This "click to play"-feature is really valuable. A lot of malware these days gets in via Flash or Java exploits.
And never run a Java applet from a site that you don't trust. If you go looking for a site that can download YouTube videos, and it requires you to run a Java plugin, keep looking. You are essentially agreeing to run a program on your computer that you have no idea what does. It's the equivalent of someone knocking on your door and asking "can I do all the things that are written on the pieces of paper I have in my suitcase" and you're not allowed to read what's on those pieces of paper in the suitcase before deciding.
Also, keeping all your software up-to-date is important. This is another reason to recommend Linux. Doing so is a hassle on Windows, but Linux just makes it incredibly easy.