Paragon Rescue Kit is a recommendable program to help prevent these kinds of malfunctions since, in case of an unexpected error, it lets you start up your computer, recover your files, and get rid of the problem in your system.
This tool creates (on an external hard drive, pendrive, CD, or DVD) a backup copy of your operating system, which you can use to do a normal startup of your PC if it experiences some malfunction.
What you have to do is copy everything you want to save to a safe place, following the steps provided by Paragon Resume Kit.
In case of a virus or system error that prevents you from starting up your PC, you just have to insert the pendrive or CD and follow the recovery steps. You'll switch out the corrupted system for the error-free one you had previously backed up and will go back to using your PC as usual.