sodcalculator

10 Tech How-To

How to Protect Your Computer from Viruses and Malware

Guide 10-37334 · Updated · Step by step

This guide walks you through practical steps to keep your computer safe from viruses, ransomware, spyware, and other malware. You’ll learn how to set up built-in protections, adopt safe browsing habits, and respond if something goes wrong. No special technical skills are needed—just follow the steps in order.

What You’ll Need

  • A computer running Windows, macOS, or a mainstream Linux distribution
  • Administrator access to install software and change system settings
  • An internet connection (for updates and downloads)
  • About 30 minutes of time

Step-by-Step

  1. Turn on your operating system’s built-in antivirus. On Windows, open Windows Security (search for it in the Start menu) and confirm that “Virus & threat protection” is active. On macOS, go to System Settings → Privacy & Security and ensure “Gatekeeper” is set to “App Store and identified developers.” These built-in tools are free and cover most threats.
  2. Enable automatic updates for your OS and software. On Windows, go to Settings → Windows Update and turn on “Automatic updates.” On macOS, go to System Settings → General → Software Update and enable “Install macOS updates” and “Install application updates from the App Store.” Also enable auto-updates in your web browser and any apps you use daily (like Zoom, Slack, or Office).
  3. Turn on the firewall. Windows: Windows Security → Firewall & network protection, and make sure the firewall is “On” for all network profiles. macOS: System Settings → Network → Firewall, and turn it on. The firewall blocks unauthorized incoming connections.
  4. Use a standard (non-admin) user account for daily work. Create a separate administrator account for installing software and changing system settings. Use the standard account for email, browsing, and documents. This limits the damage malware can do if you accidentally run it.
  5. Install a reputable ad blocker in your browser. Ad blockers reduce the risk of “malvertising” (malicious ads) and also block many tracking scripts. Choose one from the official extension store of your browser (e.g., Chrome Web Store, Firefox Add-ons).
  6. Be careful with email attachments and links. Do not open attachments or click links in unsolicited emails, even if the sender looks familiar. Verify the sender’s address and hover over links to see the real URL. If an email asks you to log in, go directly to the website by typing the address yourself.
  7. Download software only from official sources. Use the developer’s official website or the app store for your OS (Microsoft Store, Mac App Store, or the distribution’s package manager). Avoid “free download” sites, torrents, and cracked software—these are common malware vectors.
  8. Back up your important files regularly. Use an external drive or a cloud service (like OneDrive, iCloud, or Google Drive) and enable automatic backups. If ransomware hits, you can restore your files without paying.
  9. Enable multi-factor authentication (MFA) on your important accounts. For email, banking, and social media, turn on MFA (usually via a text message or an authenticator app). This prevents attackers from taking over your accounts even if they steal your password.
  10. Run a periodic manual scan. Once a month, open your antivirus and run a full scan. This catches anything that might have slipped through.

Common Mistakes

  • Disabling the built-in antivirus because you think it’s not good enough. Windows Defender and macOS’s XProtect are solid; adding a third-party antivirus can actually slow your system and cause conflicts.
  • Clicking “Allow” on every pop-up when a website asks for notification permissions or to run a script. Only allow what you need.
  • Using the same password everywhere. If one site is breached, attackers try that password on all your accounts. Use a password manager to generate unique passwords.
  • Ignoring update prompts. Those updates often contain security patches for known vulnerabilities. Delaying them leaves your system exposed.
  • Thinking “I have nothing worth stealing.” Even a basic computer can be used to send spam, mine cryptocurrency, or join a botnet—all without your knowledge.

Tips

  • Keep your browser extensions minimal. Each one is a potential attack vector.
  • Use a separate browser profile for banking and sensitive activities.
  • On Windows, enable “Controlled folder access” in Windows Security to protect your documents from ransomware.
  • On macOS, consider enabling “FileVault” to encrypt your hard drive.
  • If you use public Wi-Fi, use a VPN (Virtual Private Network) to encrypt your traffic. Many reputable VPNs are paid; free ones may sell your data.
  • Regularly review your installed programs and remove any you don’t recognize or use.

Troubleshooting

If you suspect your computer is already infected, act quickly:

  • Disconnect from the internet immediately. This prevents malware from communicating with its command server or spreading to other devices.
  • Run a full antivirus scan in offline mode if possible. Windows Security offers an “Offline scan” option; macOS users can boot into Safe Mode and run a scan.
  • If the scan finds nothing but you still see issues (pop-ups, slow performance, unexpected redirects), try a dedicated malware removal tool like Malwarebytes (free version). Download it from the official site on a clean computer and transfer it via USB if needed.
  • If you cannot boot normally, try Safe Mode (Windows: restart while holding Shift and click “Troubleshoot → Advanced options → Startup Settings”; macOS: restart while holding the power button until you see “Loading startup options”). Then run a scan.
  • If nothing works, you may need to reinstall your operating system. Back up your personal files first (if possible) and then do a clean install. This is the most reliable way to remove persistent malware.

Frequently Asked Questions

Do I really need a third-party antivirus?

No. The built-in antivirus on Windows (Microsoft Defender) and macOS (XProtect) is sufficient for most users. Third-party antivirus can be useful for extra features, but it’s not required.

Can I get a virus from visiting a website?

Yes, but it’s rare if you keep your browser and OS updated. Drive-by downloads (malware installed without your action) happen mostly on compromised or malicious sites. An ad blocker and up-to-date browser reduce the risk.

What’s the difference between a virus, a worm, and a Trojan?

A virus attaches to a file and spreads when you run it. A worm spreads on its own over networks. A Trojan disguises itself as legitimate software but does something harmful. All are malware, but they spread differently.

Should I pay the ransom if I get ransomware?

No. Paying doesn’t guarantee you’ll get your files back, and it funds criminal activity. Instead, restore from a backup. If you don’t have a backup, some ransomware has free decryption tools—search for the specific strain online.

How often should I update my passwords?

There’s no need to change passwords regularly unless you suspect a breach. Instead, use a unique, strong password for each account and enable multi-factor authentication. Change a password immediately if a service you use reports a data breach.

Is it safe to use public Wi-Fi?

It’s not inherently dangerous, but it’s risky because others on the network can intercept your traffic. Use a VPN, or at least ensure websites use HTTPS (look for the padlock icon). Avoid logging into sensitive accounts on public Wi-Fi without a VPN.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →