well the best way to be safe from viruses is being offline *not that i'm suggesting that*. Its sorta like abstinence. LoL, anyways, as it was mentioned above by mittens and all, installing an antivirus, keeping it up to date. I'd also recomend keeping yourself free of trojans, spyware and stuff as they can open doors for viruses to get in and trojans can download viruses to harm your computer even more. A good program for spyware is spybot S&D, and adaware. these two should be kept up to date at all times and do scans on your comp every week or so.
Good Luck,