Keep everything you run up-to-date (that means replacing an old Windows XP machine, because XP isn't supported any more).
Use Chrome, Firefox or Opera instead of Internet Explorer. As the biggest target, IE attracts the most attention from the evil-doers.
Set your browser to the tightest security settings you can tolerate, including Javascript settings.
Use Ad-Block and Flash-block browser extensions. Be wary of where any Flash content comes from before you run it.
Use a good anti-virus program and Spybot Search-and-Destroy.
Set up a guest account on your computer and use that for web browsing, not a "computer administrator" account.