1. Use Malwarebytes Anti-Malware for Mac to remove adware/malware.
https://www.malwarebytes.org/antimalware/mac/
Download, install , open, and run it by clicking “Scan” button to remove adware.
Once done, quit Malwarebytes Anti-Malware.
Install guide
https://support.malwarebytes.com/docs/DOC-1817
The installer may ask you to allow it in System Preferences > Security & Privacy. Allow it.
2. Disable Extensions if any and test.
Safari > Preferences > Extensions
Select, disable all extensions and test.
Enable Extensions one by one and test.
To uninstall any extension, select it and click the “Uninstall” button.
3. Safari > Preferences > Search > Search engine:
Select your preferred search engine.
4. Visit the site you want it to be the Home page
Safari > Preferences > General > Homepage
Click the button “Set to Current Page” button.
5. Restart your Mac.