How to Prevent a Computer Virus

Most computer infections come from outdated software, risky downloads, malicious attachments, or ignored warnings. A few settings and habits prevent the majority of problems without buying extra software.

Does this affect you?

Use this for Windows 10 and Windows 11 PCs. Many habits also apply to Mac, though menus differ.

Keep Windows Security on and updated

The built-in protection is strong when it is actually enabled.

  1. Open Start, search Windows Security, and open it.
  2. Choose Virus & threat protection and confirm Real-time protection is On.
  3. Open Virus & threat protection settings and keep Cloud-delivered protection and Automatic sample submission enabled.
  4. Open Settings > Windows Update > Advanced options and enable updates for other Microsoft products.
  5. Let Windows install updates automatically. Many infections exploit flaws that were patched months earlier.

Build safer download habits

Software installation is one of the biggest infection risks.

  1. Download software from the developer’s official website or Microsoft Store.
  2. Avoid download portal sites that bundle extra installers.
  3. Do not download cracked software, pirated apps, or key generators.
  4. Turn on file extensions in File Explorer so names like invoice.pdf.exe are visible.
  5. Be cautious with .exe, .scr, .bat, and similar executable files you were not expecting.
  6. Keep the browser updated and consider a reputable ad blocker to reduce malicious ads.

Back up your files

Backups do not prevent infection, but they make recovery possible after ransomware or damage.

  1. Set up File History or Windows backup to an external drive.
  2. Use cloud backup or sync for important files through OneDrive, Google Drive, or a backup service.
  3. Aim for the 3-2-1 rule: three copies, two storage types, one offline or off-site.
  4. Test restores occasionally by recovering a file from backup.

More control

Verify unexpected attachments

Even a sender you know may have a compromised account. If a link or attachment feels out of character, confirm through another channel first.

Avoid downloaded Office macros

Word or Excel files that ask you to enable macros or content are a common malware route. Do not override macro warnings unless the source is trusted.

Scan unfamiliar USB drives

Before opening a borrowed or found USB drive, scan it with Windows Security.

Secure the network too

Use a strong Wi-Fi password and keep router firmware updated so attackers have fewer paths to reach devices.

Sources

  • Microsoft Support – Stay protected with Windows Security (2025)
  • CISA – Protect yourself from malicious cyber actors (2025)
  • Federal Trade Commission – Malware (2025)
Disclosure: This post may contain affiliate links which means I may receive a commission for purchases made through links. I will only recommend products that I have personally used! Learn more on my Private Policy page.
A thoughtful woman reads a newspaper while enjoying coffee at an indoor workspace.

DEALWEEK

SUBSCRIBE AND GET 20% OFF YOUR NEXT ORDER! OFFER ENDS SOON - DON’T MISS OUT!

We don’t spam! Read our privacy policy for more info.

Shopping Cart