How to Get Rid Of a Computer Virus: 7 steps to a clean PC

Your computer’s crawling like it’s stuck in molasses, pop-ups are breeding faster than you can close them, and error messages keep interrupting whatever you were trying to do. That’s malware, and probably a computer virus.

Viruses spread through email attachments, sketchy downloads, infected USB sticks, and links that look legitimate right up until they aren’t. Once one’s in, it can corrupt files, steal passwords, or quietly hand your data to someone else. One warning before you start: a pop-up screaming that you’re infected and offering a one-click fix is usually the trap itself. Only trust alerts from antivirus software you actually installed, never the pop-up. Now let’s clean the machine, in order.

1. Disconnect from the internet

Cut the machine off first. Unplug the Ethernet cable, or switch off Wi-Fi with airplane mode. This stops the infection spreading to other devices on your network, and it kills the connection a lot of malware uses to phone home, pull down more payloads, or ship out what it’s already stolen. Starved of that line, plenty of malware goes quiet and gets much easier to remove.

Do it before you scan, not after. If you need to download a removal tool, grab it on a clean device and copy it over on a USB stick.

2. Boot into Safe Mode

Safe Mode starts Windows with only the essential drivers, so most malware never loads. That’s exactly what you want: the infection can’t defend itself, block your antivirus, or reinfect files while you’re cleaning them.

Hold Shift while you click Restart. The Settings route works too, though the path differs by version: on Windows 11 it’s Settings > System > Recovery > Advanced startup, and on Windows 10 it’s Settings > Update & Security > Recovery > Advanced startup. When the blue menu appears, go to Troubleshoot > Advanced options > Startup Settings > Restart, then press 4. Older Windows versions used the F8 key at boot. If the PC is too far gone to reach the menu, force a shutdown by holding the power button for 10 seconds, then interrupt the boot the same way twice more; the third start drops you into recovery.

While you’re in Safe Mode, run Disk Cleanup first to clear out temporary files. It speeds up the scan and sometimes clears junk malware on its own.

3. Run a full antivirus scan

This is the main event. Windows 10 and 11 already include Windows Defender, so you don’t need to buy anything. Open Windows Security, go to Virus & threat protection, choose Scan options, pick Full scan, and let it run. Not a quick scan. Full. It checks every file, including the temp folders, AppData directories, and startup entries where infections hide.

No antivirus you trust? Download Malwarebytes from its official site (not a random “free download” portal, which is how a lot of people got infected in the first place). Quarantine or delete whatever it finds, restart the machine, then run the scan a second time. A clean second pass is how you know it didn’t reinstall itself. A full scan can take an hour or more depending on how many files you have, so start it when you can leave the machine alone.

4. Run an offline scan

Some malware blocks your antivirus outright or survives a normal scan. When that happens, scan before Windows even loads. On Windows 10 and 11 it’s built in: Windows Security > Virus & threat protection > Scan options > Microsoft Defender Antivirus (offline scan) > Scan now. Save your work first, because the PC restarts and runs the scan from the recovery environment, where persistent and boot-level infections can’t hide. It takes about 15 minutes, and the results show up afterward under Protection history.

One catch: if BitLocker encryption is on your system drive, suspend it first or keep your recovery key handy, or the restart may lock you out. This is the modern replacement for the old rescue disk. If you run third-party antivirus, most vendors still offer a bootable rescue USB that does the same job from a clean computer.

5. Uninstall anything you don’t recognize

Scans miss things that arrived as ordinary programs. Open Settings > Apps > Installed apps (Windows 11) or Control Panel > Programs and Features (Windows 10), and sort by install date. Anything that showed up right when the trouble started, and that you don’t remember installing, is suspect. Junk software loves bland names like “PC App Store” or “Search Protect.”

Uninstall it and follow the prompts. Don’t assume that clears everything, though; this kind of software often leaves behind registry entries and scheduled tasks, which is why you scan around it too.

6. Clean out your browser

A hijacked browser is where a lot of the damage shows: a changed homepage, a search engine you never picked, ads shoving their way into every page. That’s often the work of adware riding in with the infection. Open your extensions and pull out anything you didn’t deliberately install. In Chrome or Edge you reach them through the menu under Extensions > Manage Extensions; in Firefox it’s the menu under Add-ons and Themes > Extensions.

If you’re not sure what an extension does and you didn’t choose it, remove it. Reset your homepage and default search while you’re in there. You can always add the legitimate ones back later.

7. Scan from another computer

Still stuck? Take the scan to the malware instead. On a home network, reach the infected machine’s files from a clean computer and scan them from there; a scanner running on a healthy system can’t be blocked by the infection.

No network, or the machine won’t boot at all? Pull the hard drive out (carefully) and connect it to another computer as a secondary drive, then scan it from that machine. It’s more work, but it’s the option that works when nothing on the infected PC will cooperate.

If the same threat keeps coming back after all this, you may be dealing with a rootkit or ransomware dug in deeper than a scan can reach. At that point, backing up your files and reinstalling Windows is the clean fix, and a local repair shop can handle it if you’d rather not. Either way, change your important passwords from a device you know is clean.