Q1) There are many ways a computer can get infected with a virus.
Here are some common ones:
Accepting without reading
By far one of the most common ways a computer becomes infected is the user simply accepts what he or she sees on the screen without reading the prompt and/or understand what it's asking.
Opening e-mail attachments
Another very common way people become infected with viruses and other spyware is by opening e-mail attachments, even when from a co-worker, friend, or family member. E-mail addresses can be easily faked and even when not faked your acquaintance may unsuspectingly be forwarding you an infected file.
Not running the latest updates
Many of the updates, especially those associated with Microsoft Windows and other operating systems and programs, are security updates. Running a program or operating system that is not up-to-date with the latest updates can be a big security risk and can be a way your computer becomes infected.
In addition to running operating system updates, the plugins associated with your browser can often contain security vulnerabilities. Make sure you have the latest versions of plugins.
Pirating software, music and/or movies
If you or someone on your computer is participating in underground places on the Internet where you're downloading copyrighted music, movies, software, etc. for free, often many of the files can contain viruses, spyware and/or malicious software.
No anti-virus spyware scanner
If you're running a computer with Microsoft Windows it's highly recommended you have some form of anti-virus and spyware protection on that computer to help clean it from any infections currently on the computer and to help prevent any future infections.
Finally, downloading any other software from the Internet can also contain viruses and other malware. When downloading any type of software (programs, utilities, games, updates, demos, etc.), make sure you're downloading the software from a reliable source and while installing it you're reading all prompts about what the program is putting on your computer.
Caution: Some websites have scripts that automatically downloads into your computer as a virus.
Originally from ComputerHope with a few edits.
Q2) Always update your anti-virus engine and virus definitions.
Also, be careful in what you're downloading, especially pirated software as many of them contain malware.
Download software from trusted sites and not from random places.
Do regular malware scans.
And be careful. Anything could happen, even at trusted sites, so always be on the lookout.
3) Anti-virus software usually detect malware by examining files for known virus code/signatures in a virus code or looking for any suspicious behavior that may be linked to malware. Many malware often contain similar codes or signatures.
In a case that this happens, try updating your anti-virus first. Then, do a virus scan and remove malicious items. Report the malware online. IF none of these works, as a last resort, make sure you have a non-malware infected backup and reinstall your OS.
4) I'm too lazy to answer this question. Ask someone else to do it.