Ransomware is easily defeated if you backup your files periodically. You may lose the information since your last back up but that is it.
Backup to iCloud
It seems the Mac computers don’t have this problem. Although they are very good at this, it doesn’t mean the hackers won’t bug you. My wife has had 2 ransom incidents, she calls Apple and they take care of the problem.