Adware, spyware, viruses, and trojans are all programs you don't want on your computer. Sometimes they're hidden and you never know they're there, and other times you actually install them yourself without realizing it because they're bundled with some type of legitimate software and you didn't both unchecking the box for the optional install. No matter how it gets on your computer, it's still annoying and can really test your patience when working on your computer. Most people have become aware of this problem, but a lot of them still don't know what to do if they happen to have this installed. There's a lot more information that what I'm going to type in this entry, but it'll be a decent starting point for those of you who don't know where to begin. All of the software I'm going to list is free to download. Some of them may accept donations, or have versions you can pay for, so if you like the program or it helps you out, feel free to help out the software developer so they can continue providing great freebies for us.
First off, if you don't have any malicious programs installed, make sure you're protected so you never get any. Javacool's SpywareBlaster and Spybot Search & Destroy both work to prevent spyware in the first place. I use a combination of both. SpywareBlaster needs to be updated manually every so often in order to stay current with protection, but also offers an inexpensive license that will allow the program to autoupdate. Spybot S&D performs an "immunization" of your computer, which also needs to be manually updated every now and then. One bonus of Spybot is that it also provides scanning and removal service for some malicious software as well.
Two more applications you'll want to install are SuperAntiSpyware and Lavasoft's Ad-aware 2008. These two programs will help you scan and remove any malicious programs you already have installed on your machine. It's best to use a combination of programs because each of them seem to find most, but not all infections. Using a combination increases your chances of finding and removing all infections. SuperAntiSpyware contains an autoupdate feature, and had performed the best for me. Ad-aware has plenty of versions, but the free version is all you really need.
If you're in need of an anti-virus program, check out AVG Free Edition, or Avast!. Both are free and can be used to replace your annual subscription to McAfee or Norton. But make sure you only have ONE anti-virus installed on your machine at any given time. You can have multiple spyware/adware protection programs install, like the ones mentioned above, but you shouldn't install more than one anti-virus. The reason being that conflicts amongst anti-virus programs seem to happen a lot, and I learned that from experience. I had Symantec and McAfee installed without realizing it, and my computer practically grinded to a halt until I went through a lengthy, manual uninstall of both.
One last program you'll probably want is Piriform's CCleaner. It'll help clean your temporary files, and also clean out some other files that you normally wouldn't think of removing.
If you do end up having a really bad software infection, you may need to download these programs from a different computer, then transfer them to the infected machine using a CD, USB drive, etc. One thing you'll want to make sure of when removing spyware/adware is to exit any network connections. Either disable your network adapter(s), or just unplug the cable if you don't have wireless. If you don't, the malicious software may just continually download and reinstall itself, so you'll end up in a continuous loop of removal, scan, remove, scan... When you are scanning, keep repeating the scan until it doesn't find anything, then move to the next program and do the same thing.