Go step by step and test.
1. Quit Safari, launch Safari holding the Shift key down.
https://support.apple.com/en-us/HT203987
2. 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.
3. Check for adware.
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.
4. Remove unknown extensions: Safari > Preferences > Extensions
https://support.apple.com/guide/safari/use-safari-extensions-sfri32508/mac