This method requires Group Policy Editor (gpedit.msc). This requires Windows Professional.
If you have Windows Home, there is a way: Enable Group Policy Editor on Windows Home
Open gpedit.msc
Computer Configuration → Administrative Templates → Windows Components → Microsoft Defender Antivirus → Real-Time Protection
Open “Turn off Real-Time Protection” and select Enabled