Popups
1. Click menu in the menu bar, hold the shift key on the keyboard down
and choose “Force Quit Safari” from the dropdown.
Safari will quit.
Launch Safari holding the shift key down.
2. Pop-ups and ads in Safari
Quoting:
" If you see an annoying pop-up in Safari, you can go to the Search field and enter a new URL
or search term to browse to a new site.
If you don’t see the Search field on your iPhone, iPad, or iPod touch, tap the top of the screen to make it appear.
Some popups and ads have fake buttons that resemble the close button,
so use caution if you try to close a pop-up or ad.
If you're unsure, avoid interacting with the popup or ad and close the Safari window or tab."
https://support.apple.com/en-us/HT203987
3. Run the latest release of MalwareBytes for Mac to remove malware/adware.
Install guide: https://support.malwarebytes.com/docs/DOC-1817
Uninstall Guide: https://support.malwarebytes.com/docs/DOC-1190
The installer may ask you to allow it in Security & Privacy /System Preference. Allow it.
Click the blue “Scan Now” button.
Once done, scan again. Quit Malwarebytes for Mac.