Windows 10 and 11 both have built-in features that can help protect against ransomware. To enable Windows ransomware protection, find Ransomware protection under the Virus and threat protection tab within the Windows Security app and turn on Controlled folder access.
Just note that Windows Security may not be enough to protect you from all malware strains — a comprehensive cybersecurity solution like Avast One will protect you against new and emerging malware threats, as well as phishing attacks and data breaches. Plus, Avast One includes a built-in free VPN and other advanced privacy tools.