Windows 10 has had built-in protection against ransomware for some time. As a result, the contents of all user folders are automatically backed up to OneDrive so that they can be accessed in the event of an emergency. However, this requires Windows 10 to be used with a Microsoft account, because if you do this with a local user account, you have to manually turn on this kind of protection. However, even then you will not get away with using a Microsoft account, as you will still need it for OneDrive.
Use Windows+I to open Windows Explorer, click on the Update and Security icon, select Windows Security from the left-hand column, then select Virus and Threat Management. Scroll down to Anti-malware and click on the Manage Anti-malware link, then click on the Setup OneDrive button. Enter the email address of your Microsoft account and click Sign in. Enter your password, click Sign in and follow the on-screen instructions.
If you are using third-party antivirus software, these options are not available by default. To set up protection against ransomware, you must first click on the Microsoft Defender antivirus settings link in blue, set the Scan regularly check box to On, and answer yes to the question about monitoring user accounts.
Learn more about effective protection against ransomware here!