Go step by step and test.
1. Force Quit Safari, launch Safari holding the Shift key down.
How to force an app to quit on your Mac - Apple Support
About pop-up ads and windows in Safari - Apple Support
2. Startup in Safe Mode.
Start up your Mac in safe mode - Apple Support.
Quote:
It also does a basic check of your startup disk, similar to using First Aid in Disk Utility.
And it deletes some system caches, including font caches and
the kernel cache, which are automatically created again as needed.
3. Clear History
Clear your browsing history in Safari on Mac - Apple Support
Please read the article before clearing history,
this is like a low level resetting of Safari without affecting passwords and bookmarks.
4. If Safari doesn't open a webpage or isn’t working as expected
If Safari on Mac doesn't open a webpage or isn’t working as expected - Apple Support
5. If this doesn’t help:
Download EtreCheck: https://etrecheck.com/maspro ,run it and post the report here.
Click “Click to download” button,
Open Downloads folder, click on it to open, and then select ”Open”.
“Choose a problem” from the popup menu box, and then “Start EtreCheck” in the dialog.
Click “Share Report” button in the toolbar, select “Copy report” .
Paste the report when you reply.