Best thing to do is to download some spyware removal tools and give them a shot. They may pick up and remove a lot of these trouble programs for you. The two I always recommend are Ad-Aware (
http://www.lavasoftusa.com/) and Spybot: Search & Destroy (
http://www.safer-networking.org/en/index.html). Both of these are free. There are number of different programs out there but these are two of the most popular.
Apart from that, it's just a case of watching what you are downloading. If you ever get any prompts while surfing the internet saying something like "Do you want to install..." only ever click Yes if you are 100% sure of what the program is.
Try giving this post a read as well -
https://www.askmehelpdesk.com/showthread.php?t=7286 . It'll give you a few ideas of some useful programs that people recommend.