The first thing I would do is Clear History from the Safari menu. After that quit and re-launch Safari while holding down the Shift key. That will launch Safari in Safe Mode and disable any third party extensions.
If Safari behaves itself after that, disable your extensions and re-enable them one at a time.
Failing that, more extreme measures are in order. I would start with a preferences clean. Quit Safari and then in Finder hold down the Option and select the Go menu and then "Library" from that menu.
Once the Library folder is open look for a folder or folders with Safari in the name and move the contents of each to folders on your Desktop. Then look for a Preferences folder in the Library folder and open it up. Look for any file/folder with Safari in the name and move them to the desktop. Once the library folder is clear of Safari-related files Try safari then and see how things are working.
If things are still not working properly I would download and install the Combo update for the current version of your macOS. Search on "combo update mac os 10.14.5" (or whatever your current version is). It will lead you to a large file on apple.com. Download and run it. It will update your OS and will usually fix problems such as this.
If that still does not fix the problems let us know.