Google search engine turns into yahoo randomly
I was searching in my 21.5" iMac when suddenly search engine turned into yahoo! I went to safari preferences and I saw that it was set to google. I attempted to search again but got the same result. I changed to duckduckgo and now my search engine was duckduckgo! I changed back to google and it was yahoo. I saw many articles and did what they said but it was no use. I tried blocking yahoo from system prefrences>screen time>content and privacy>content>limit adult content>customize. But now when I search for anything, it says website blocked. So I unblocked it. I noticed that this websitec ***. I think it is a virus. I tried blocking it but then I got the same result as when I blocked yahoo. There is this weird mysterious app on my Mac it looks like this:
I have no idea what it does! This all started when I installed grammerly for safari but now it is deleted.
I tried to download chrome but it won't open. I tried deleting safari but found out that it was not on the App Store. I really don't know what to do. This is a quick Screen Recording of what happens...
It first is google, then it goes to this website, http://search.x6b4l.com. Then (I didn't catch it in the video) it turns into yahoo. Please help me. About this Mac is below. Thanks!
[Link Edited by Moderator]