Microsoft has a hidden anti-ransomware feature in Windows 10 that you can enable

It’s as simple as searching up ‘ransomware protection’ in the start menu, and ticking the box for ‘controlled folder access’, which doesn’t seem to be enabled by default as you’d expect. It’s described as a feature that stops ‘unfriendly applications’ from making changes to your files, folders, and memory.