Go step by step and test.
1. Update Safari, if an update is available. Update may come with bug fixes.
Update to the latest version of Safari - Apple Support
Update macOS on Mac - Apple Support
2. Force Quit Safari, launch Safari holding the Shift key down.
About pop-up ads and windows in Safari - Apple Support
3. 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.
4. 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.
5. If Safari doesn't open a webpage or isn’t working as expected
https://support.apple.com/en-us/HT204098