The best defense against ransomware is avoiding sites and downloads riddled with it ... picks for best antivirus software. In the Windows Security app, click on Virus & threat protection.
If you have received a notification from the Windows Security app on your PC, check using Task manager if the process belongs to Windows Security or if some other app is trying to impersonate it.