If you're not already running the latest version of OS X ('El Capitan'), updating or upgrading in the App Store may cause the adware to be removed automatically. But before you follow those instructions, you can attempt an automatic removal.
Some of the most common types of adware can be removed by following Apple's instructions. You may have installed ad-injection malware ('adware'). That's how you cause problems, not how you solve them.
First, never use any kind of 'anti-virus' or 'anti-malware' software on a Mac.