Depends on the kinds of ads that you get. If you're talking about "normal" ads, then using an adblocker plugin for your browser should do the trick.
However, if you've got some sort of adware on your computer, then you will have to use an Anti-Malware. I personally use MalwareFox .