A lot of people say that there are no viruses on Apple devices as the OS architecture simply does not allow it. These people are partially right. But only in terms of real computer viruses. It is extremely hard for viruses to penetrate the Apple device, although some cases happen from time to time.
However, lets focus not on dangerous viruses but malware and adware. There are tons of nasty infections like Search Baron that modify browser settings, open new tabs, redirect users to irrelevant websites, and show shady ads.
Things like Yahoo redirect are not viruses or ransomware. It is just adware. It cannot infect computers by hopping from one device to another and cloning itself. It cannot also encrypt files or hard drives or cause some significant harm. Its actions have to do mostly with intrusive and misleading advertising. However, nobody knows what sites this adware may redirect you to next time. You may end up on a phishing site intended to collect private data that can be later used for identity theft.
It is crucial to remove any adware that penetrated your macOS device. However, there are some problems with this. In case you wish to uninstall Mac malware, it is not easy to quickly find a good solution. Simple Google search returns inappropriate results. Searching for terms like “remove Mac adware,” you see that top results are occupied by sites offering to buy unknown antiviruses. All these shady security tools do nothing. They cannot scan and remove viruses as the Apple ecosystem is built in such a way that it does not allow accessing other apps' data.
In case your device is infected with malware, and you want to quickly get rid of it, call Apple and ask for help. Their phone numbers can be found here: support.apple.com/en-gb/HT201232. You can also visit an authorized Apple repair store located near you. Keep in mind that sometimes their services cost a lot of money.
One more option is to try Apple communities. Thousands of enthusiasts assist users with any type of Apple-related issues. Check yourself by visiting, for example, the macOS Big Sur section: discussions.apple.com/community/mac_os/big-sur
There are more solutions too. macOS is not difficult to use. Users can remove malware manually by following the step-by-step guides offered all around the web on websites dedicated to cybersecurity and virus removal. For example, here is a long guide by MacSecurity.net on how to get rid of Search Baron malware.
Malicious software may exploit vulnerabilities of any device. macOS is not totally immune and has its own bugs too. To fix them, Apple systematically releases software updates. Although macOS is still not as attractive to hackers as Windows, and they still have not flooded it with malware, the beginning of this process is clearly seen. Mac adware and primitive versions of other malware are already out there.