How?
First, it requires discipline. It requires being paranoid about every click of every link. It requires software that can pull apart a WEB page and tell you what is going to happen, if you load the WEB page, before you actually load it.
It requires avoiding all Windows based servers. It requires avoiding sites like Facebook, Youtube, Twitter, Gmail, Hotmail, and so on. It requires disabling Java for everything and enabling it once you are clear on what the site is going to do. It requires avoiding email attachments. It requires an email reader that will only open email in 'text' mode. It requires blocking all Flash based items.
There is so much more to it. It is a discipline. It is about taking control of your computer and not allowing everyone else to control it.
99.9% of the people I know cannot handle it and I am fine with that. I enjoy using my computer for what I want to do with it and not what others think I should be doing with it.
stay off the pron sites, don't use social network sites, don't click on links people send to you via email, and don't use file sharing programs of any kind...just to start.
if you really can't help yourself there are some tools available that can help you circumvent the most common infections...but you still have to know what you're doing to keep your system secure. symantec/norton, mcafee, trend micro and others like them are useless as screen doors on a submarine.
All anti-xxx software is designed to induce paranoia in the user. That is how they hook you. If they really wanted to do it right they would stop trying to "filter" viruses and work on closing the doors than allow viruses in, but then they could work themselves out of business doing that.