Hello Charliefowles,
Thank you for participating in the Apple Support Communities! We understand that you've been experiencing unexpected pop-ups on your MacBook Air and you've come to the right place for help.
It sounds like you may be experiencing the behavior outlined in the following support article:
About pop-up ads and windows in Safari - Apple Support
If you see an annoying pop-up ad 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 pop-ups 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 pop-up or ad and close the Safari window or tab.
On your Mac, you can also update your settings to prevent windows from opening again after you close Safari, or just press and hold the Shift key when you open Safari."
It's possible that you may have malware on your Mac, What is malware on Mac? - Apple Support. Consider following the suggestions outlined in Protect your Mac from malware - Apple Support or trying a third-party tool to remove unwanted adware or malware, such as the following: Malwarebytes for Mac — Mac Antivirus Replacement | Malwarebytes
Take care.