Have you been encoutering with advertisment opeing up in new tabs!? Worry no more!! I understand your pain, I had that same issues too, when ever i opened up my chorme or safari, i would see advertisments opening up in a new tab, it really pissed me off too!
I had a hard time doing my assignments and stuff.
Here is the soution, do not fall into the trap by downloading third party software for this issue! it wont work!
Its simple, visit the link: https://support.apple.com/en-sg/HT203987 . Peers in Apple are awesome, They have you covered, simply follow their steps. Don't worry if you could not find some or afew of the files as stated in by Apple, everything is fine, simply follow the steps from the starting to the end, you will definitely encounter a couple of files, delete them accordingly and you are good to go :)
Additonal tips:
"Go to folder" - Command + Shift + G
"Finder" - Command + Shift
I have been using CCleaner, its an excellent software for getting rid of cookies,browing history and unwanted stuff stored in your harddisk, it a one stop service for clearing unwanted trash.