A computer virus is essentially a piece of code that attaches itself to files and programs under the pretext of being something positive and spreads to other program systems, files and recipients without the user's knowledge or consent. These viruses infect your computer and cause havoc by changing data and destroying files.
Some of the most commony heard of computer viruses include Trojan Horses, Worms and File Infectors.
Here are some of the most effective ways to avoid getting infected by a computer virus:
Install antivirus software
This is your primary defense against computer viruses. Anti virus software scans all diskettes and e-mail attachments to make sure they are virus free before you download content from these sources on to your computer. If the anti virus software does detect the presence of a virus, it warns you against downloading any content from that source. If any harmful virus does manage to slide past your watchful eye, the anti virus software will quarantine and inoculate the virus, preventing it's dispersal through your computer.
Do not open mail from unknown senders
If you do not recognize the sender, do not open the mail; it's that simple. E-mails from unknown senders are virus infections waiting to happen, this is more so with attachments that end with .vbt, .com or .exe extensions. If it looks suspicious, the best thing to do is to permanently delete it, unopened, from your inbox and also from your 'deleted messages' folder.
Update yourself about the latest viruses doing the rounds and stay informed about the most effective cures so you are always prepared in case you happen to be the next victim.
Back up, Back up, Back up …
No matter what you do to protect your computer, you are never 100% safe. Everyday there are newer and more powerful viruses being developed and it is almost impossible to protect your computer from each and every one of them. Your best option then is to back up all your important data and operating systems regularly. Backing up allows you to retrieve lost data and minimize the damage done in case of any virus infection.