Anything hooked into your OS will be susceptible to the same issue.
What you need is a backup system that saves those essentials....emails...docs...photos...work...etc. systematically at an appropriate scheduled interval.
My system can be hit with ransomeware today...and I can restore my system to exactly as it was...yesterday.
Max loss....1 day.
Everything is done with redundancy.... files are separately backed to secondary hard drives daily. Also, the entire OS drive is imaged again to a separate [not the same] drive daily.
Weekly those files are backed again..to yet another drive...so secondary failure means loss of a week.
Last total OS 'stuff up' I experienced [my fault] saw me lose a grand total of 1 day's email....and nothing else at all [other than the time to restore everything again].
You need to look up the likes of Acronis...and Syncback [in particular]...