About 99 percent of apps offered through pop-ups are scams and caused by adware. You need NO third-party utilities to make your Mac better. In fact, installing anti-virus apps, cleaning apps, and anything that claims to speed up your Mac does more harm than good because they interfere with the protection you paid Apple to build into its very robust operating system.
The only third-part apps the senior contributors trust and recommend is for exactly your issue, adware caught from visiting unscrupulous web sites. It is MalwareBytes, written by one of our most respected members. To avoid any more malware, get it only from the developer's site:
https://www.malwarebytes.com/mac/
It should fix your current problem.