Make sure you always have a trusted antivirus and make sure it is valid and up to date.
Make sure you always have the latest version of your chosen browser installed.
Make sure you have firewall switched on, windows comes with a brilliant firewall software that detects traffic between the computer and the internet. You can check that the firewall on your computer is switched on by searching for it in the control panel or start bar.
Even some of the best antivirus software's can miss occasional malware attacks, so always make sure you have one that scans when you tell it to and do a scan once a week.