Spyware
The best protection is to get a program that protects against spyware. However, many websites that claim to have them are actually spyware, not something to protect against it. This method of installing spyware is called a Trojan horse which looks like a normal program, but when it runs, it collects information to use against you. Spyware tracks your computer and uses some of the things on it. This includes your files, your downloads, and usernames/passwords for websites and programs. With this, the trojan operator can log into your accounts.