Yes, Windows 10 and Windows 11 protect against ransomware. Known as Controlled Folder Access, this feature enables you to let only fully vetted applications access your files. And it will prevent known ransomware strains from accessing your files.