About prevention there is something more that I am not sure has been mentioned, some tools are taking a new, broader approach to the problem, which is to constantly monitor for encrypted files and stop the associated processes, this way often limiting the loss to a few files, these are the links:
Criptostalker https://github.com/unixist/cryptostalker
Ransomwhere (macOS) https://objective-see.com/products/ransomwhere.html
Some theoretical information on this approach: