The Cybersecurity and Infrastructure Security Agency (CISA), part of the Department of Homeland Security (DHS), acts as the cybersecurity and infrastructure security knowledge base for federal agencies and their network systems. They have published a list of various tools and measures for preventing malware attacks.
Installing an antivirus software is at the top of their list. They recommend sticking to a reputable vendor and buying directly from their website rather than clicking on advertisements or email links.
Installation of a firewall can prevent infection by blocking malicious traffic before it enters your computer. Several operating systems include a firewall for free. Some antivirus software also have an antivirus included.
Simple common sense and a precautions attitude should also be exercised. Be cautious of unknown email attachments and when clicking on email links. Be wary or, if possible, avoid public Wi-Fi as unsecured networks allow an attacker to intercept your device’s network traffic.
Something that is specifically noted is that regardless of what software you choose, having it up to date is just as important as having it installed in the first place. New vulnerabilities are always being discovered and you want the latest software patches installed. Automatic updates should be enabled to make management easier.
In the event of an actual attack where systems and their files are lost it is also important to have a way to recover. CISA recommends backing up important documents, photos, and emails to the cloud or an external hard drive.