"Yes but I thought "Macs don't get viruses"?"
I think you may be thinking about claims made about Chromebooks. They even feature in advertising for the Chromebook.
The first Mac virus I recall seeing was nVir in 1987. Then John Norstadt's Disinfectant appeared as the first anti-Malware software that I had seen. Graham Cluley has documented the history of Mac malware. It's worth a read. I haven't seen anyone other than the terminally clueless state that Macs don't get viruses. Although with OSX the scope for viruses to propagate has been severely curtailed and proofs of concept often require a lot of user compliance to give the virus the permissions it needs to infect system files.
As someone else has said, malware that runs in userspace is more of an issue. Ransomware, crypto-currency miners, Trojans etc only need user permissions to do their stuff. If you can execute code on your computer then malware can execute on your computer. The only effective way to stop it is to make it a pain to use your computer.