The easiest way to prevent this is to do all of your internet surfing from a virtual PC. I’ve been doing this for about 4 years. Any time the Virtual system acts up. I shut it off, erase it and clone in a new untouched virtual system and continue. It takes 10 minutes to clone the backup OS and start over.
It also crypts attached drives.
What are you using? I’ve used VMware, but started using Virtualbox on a computer that wouldn’t run VMware. I’m liking Virtualbox a lot better as I use it more.