How to tell if your Mac has a virus
MacOS machines are not virus-free. No matter how much you boast about that, that’s the truth. Be careful before you start clicking about on the net.
Acknowledging that you are not immune is the first step of setting up your system for avoiding infection. You can lose important files if your system crash, if you get locked out or your file is corrupted.
Here’s how to avoid virus, scan your machine, and possibly get rid of the virus.
On the surface, your computer may be working fine, but it may be infected without you knowing it.
Computer viruses like real viruses are very cunning. They may be in your computer system and they would wait until they get the perfect time to attack.
Some, viruses like worms and bugs would multiply themselves and slow down your processing speed. While some are specific for a job. They may target back log ins or passwords or infiltrate your microphone or camera.
Do you suspect that your mac is infected by a virus? This are signs to look for:
Browser extensions installed without your knowledge.
The home page of your browser that has been modified.
An explosion in the number of popups that appear when you surf.
An increase in security alerts from macOS.
Some of your files are no longer accessible.
In some cases, some of these concerns are not very serious. Adware is pretty bad, but it won’t harm your machine. If you no longer have access to certain files, on the other hand, it could be a sign of the presence of ransomware, which is much more serious.

How to scan your Mac for viruses
There are many applications to scan your Mac for viruses. Some of the more popular options include Avast, CleanMyMac X, and Clario, to name just a few. You can try other apps to see if the features are right for you.
Apart from that, Apple also includes antivirus software in macOS. This one was introduced in 2009, it is XProtect, which scans applications and files against a database of known threats. The tool can also prevent downloads and notify users when appropriate.
There is also the Malware Removal Tool, which can help remove possible viruses that may have escaped XProtect.
While the built-in tools may be enough for you, having a second or even a third option isn’t a bad idea, especially if you have sensitive files on your machine that you don’t want to be stolen.
How to protect your Mac from viruses
There are some general rules to follow to stay (relatively) safe online and avoid infecting your machine:
Do not open or download attached files in suspicious emails.
Do not download any files from unknown sites. Unknown or unsafe sites are marked with lacking a SSl certificate and your browser would display on icon (a triangle, usually red with an exclamation sign in the middle) to warn you off these sites.
If your browser warns you when you want to access a site, you should listen to it.
Apple shares a number of tips for protecting your Mac against malware. Among these is to ensure that applications are downloaded from safe sources.
Apple also has features built into macOS that you can turn on to prevent downloads and installations from untrusted sources.
Click on the Apple logo at the top left of your screen and select System Preferences.
Then click on Security and confidentiality and then on General.
If the padlock icon at the top left is locked, click to unlock it.
From there, you can choose the sources from which the software can be installed. You can choose App Store or App Store and identified developers. According to Apple:
App Store:
Allows installations from the Mac App Store. This is the safest setting. All application developers in the Mac App Store are identified by Apple and each application is analyzed before being accepted.
MacOS checks the app before opening it for the first time to make sure it hasn’t changed since developer deployment. If there is any problem with an app, Apple removes it from its Mac App Store.
App Store and Identified Developers:
Allows installations from the Mac App Store and from Identified Developers.
Identified developers are registered with Apple and can send their apps to Apple for security verification. If something goes wrong with an app, Apple can revoke its authorization.
Likewise, MacOS checks the app before opening it for the first time to make sure it hasn’t changed since developer deployment.
Conclusion
Preventing your Mac from getting infected is way better than trying to get rid of the virus. Be being vigilant of suspicious looking malware and avoiding them totally, you can have a smooth sail using your computer.