Unfortunately, it became quite easy nowadays to infect your computer with malware:
- Accepting some plug-in or toolbar installation
- Opening email attachments “thesisgenerator.exe”
- Not running the latest updates on the operating system, the browser, etc.
- Installing software or media from unknown sources
- Running your system without a firewall
Sometimes, webpages try to scare users to install a trojan. For example, there exists a trojan version of the program MacSweeper, which promises to clean your system 😛
More on the topic: http://www.computerhope.com/issues/ch001045.htm