If Safari has been hijacked then use this method. The first step is to find Activity Monitor.
This app is in the Utilities folder in the Applications folder. Start Activity Monitor and find Safari in the list of running processes. Double click Safari and a window will open that will allow you to kill the Safari process.
In a Finder window, hold down the Option key while in the Go menu.
Go into the Library folder to the Saved Application State folder. Find the folder named com.apple.Safari.savedState and delete the contents. Restart Safari. Go to Safari preferences to the Privacy tab. Click on the Remove All Website Data button to remove cookies etc. Then go to Safari / Reset Safari and reset.
Make sure there are no strange extensions loading in your Safari Preferences.
Malwarebytes Anti-Malware for Mac scans for and removes code that degrades performance or attacks your system. Making your Mac, once again, your Mac.