Use Antivirus and Antimalware
Antimalware and antivirus are points of contention among security researchers. While they can help root out and remove various types of malicious files on your system, they’re oftentimes a bit bloated and come with unnecessary features that will hamper your Mac.
They’re also not a perfect substitute for good browsing habits. New malware isn’t always detectable, and there are plenty of tactics hackers can use to evade antivirus. All of this is to say that you should do the research and only choose a reputable antivirus, like Malwarebytes. But don’t think it’s a one-stop solution.