Still never been a (self replicating) virus for OS X. Some Trojans, which require user acceptance. Recently a couple of ransom malware being spread by MS word attachments, but again positive user acceptance needed.
Practice safe OS (X), don't use an administrative user for normal work, don't give admin access to other users of your Mac, or tell them your password. If you get a prompt asking for permission to download something, make sure that's what you want to do. Remember all existing malware needs to be installed with an administrators permission/password.
Keep an eye out for media reports of new threats to OS X, they are so rare that they get a lot of media attention.
Those two are the best protection for OS X.