There are a few things that can be stated.
First, you can buy a program to protect you computer. If you go this route, you should get Norton anti-virus. This is the standard program that people use. It has been around for a long time and they have been reliable. Moreover, they have live updates, which is important. As you probably know, there are new viruses all the time. So, updates are essential.
Second, you can change computer platforms. For example, apple computers have very few viruses. Viruses are more of a PC problem.
Finally, just be smart as well. Don't open up attachments from people you do not know and do not go on high-risk websites.