Go step by step and test.
1. Update Safari, if an update is available. Update may come with bug fixes.
https://support.apple.com/en-us/HT204416
2. Shutdown the computer by holding the power button for 10 seconds.
Restart the computer. Launch Safari holding the Shift key down.
https://support.apple.com/en-us/HT203987
3. Startup in Safe Mode. https://support.apple.com/guide/mac-help/start-up-your-mac-in-safe-mode-mh21245/mac.
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
https://support.apple.com/guide/safari/clear-your-browsing-history-sfri47acf5d6/mac
Please read the article before clearing history,
this is like a low level resetting of Safari without affecting passwords and bookmarks.
5. Remove adware if installed on your Mac..
Run the latest release of Malwarebytes for Mac to remove malware/adware, if installed on your Mac.
For instructions: Install Malwarebytes for Mac v4 Uninstall Malwarebytes for Mac
Click the “FREE DOWNLOAD” button.
Click the “Scan ” button. Once done, quit Malwarebytes for Mac.
Restart the computer and relaunch Safari holding the shift key down.
Scan for Malware again.
Additional steps if necessary.
2. Reset search engine: https://support.apple.com/guide/safari/customize-your-search-ibrwe75c2a3c/mac
3. Reset Homepage. https://support.apple.com/guide/safari/set-your-homepage-ibrw1020/mac
4. Remove unknown extensions: Safari > Preferences > Extensions
https://support.apple.com/guide/safari/use-safari-extensions-sfri32508/mac