Always make sure you install the latest software updates for all your Apple products. Many software releases have important security updates and may include improvements that help control pop-ups.
The safest place to download apps for your Mac is the Mac App Store. If you need third-party software for your Mac, and it isn’t available in the App Store, get it directly from the developer or another reliable source, rather than through an ad or link.
Make sure Safari security settings are turned on, particularly Block Pop-ups and Fraudulent Website Warning.
On your iPhone, iPad, or iPod touch, go to Settings > Safari and turn on Block Pop-ups and Fraudulent Website Warning.
On your Mac you can find these same options in the Security tab of Safari preferences. You can also click the Extensions tab in Safari preferences to check if you have any extensions installed that you prefer to turn off.
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.
If you see pop-ups on your Mac that just won’t go away, you might have inadvertently downloaded and installed adware (advertising-supported software) or other unwanted software. Certain third-party download sites might include programs that you don’t want with the software that you install.
If you think that you might have malware or adware on your Mac, update to the latest version of macOS. If your Mac is already running the latest version, restart it. macOS includes a built-in tool that removes known malware when you restart your Mac.
Check your Applications folder to see if you have any apps that you didn’t expect and uninstall them. If you continue to see advertising or other unwanted programs on your Mac, contact Apple.