It is a well-known fact that a Mac is safer against unwanted viruses than other machines; unfortunately this is no longer the case. It would be safer for Mac users to be aware that new vulnerabilities arise all the time and that the OS is not immune to infections.
A known virus that has only been a Windows problem is the Microsoft Word macro virus, but this has just changed as the first ever Word macro attack has been reported on the MacOS. Much like the Windows version, a Python code runs after opening a word document from an unknown source. The code can grab passwords, access your webcam and save your browser history.
It is no longer true that viruses and malware are only a problem for Windows users, as more attacks on MacOS have been identified in recent years. It seems that malicious parties are starting to pay more attention to the previously untouched operating system.