My PC was infected with ransomware and I lost many files. I always backup my C: drive so I was able to restore my operating sytem. I lost some files on my D: drive due to the ransomware so now I always backup this drive more often as well.
My solution to this ransomware problem is to use Deep Freeze (www.faronics.com) to protect all files on drive C:. Deep Freeze redirects all information written to the hard drive to an allocation table, leaving the original data intact. With a reboot, any unwelcome or unwanted changes are removed from the system, restoring it to its pristine Frozen state.
The inconvenience of having to save active files on another drive is no problem. Deep Freeze allows you to temporarily deactivate (thaw) the program so you can periodically update Windows or add programs to the protected drives.
I also recommend updating any protected drives with any added or revised data routinely so all new files are also protected. For example - if you own a business and have important client and financial data - you could add the new or revised files once a day to a protected drive so they can be restored in case of a ransomware attack
It is unfortunate that malware and ransomware make it necessary to protect your files, but this method works for me. I have many irreplaceable files that I do not want to lose, so I use this as my selected safety measure.