Firstly, there is developer mode and this is a potential security flaw that could let in rogue apps that contain malware or spyware. It is intended to allow developers to test software, which is fine, but lowering security does allow other, possibly malicious, apps to be installed.
Press Windows+I to open the Settings app. Click Update & Security, and then select For developers on the left.
If you have ever installed Visual Studio, a Microsoft tool for creating software, then the Sideload apps or Developer mode setting will be selected. It enables you to install your own apps for test purposes. Normally only apps from the Windows Store can install and run.
If you ever want to install an app from outside the Windows Store, switch to developer mode. However, you should beware of malware and only use a source you really trust. Stick to Windows Store apps for safety.
Another security feature is Windows SmartScreen. This is a feature that prevents malware from being installed in Windows. It is not just for the apps in the Windows Store and regular software downloaded from websites are protected by Windows SmartScreen.
When it is turned on, and it should be, Windows will not let unknown apps run. There is a link in the warning message that appears on the screen to enable you to run the software anyway, but it is not recommended unless you know the software is safe.
SmartScreen rarely pops up a warning, even on the most secure setting. I don't know whether it uses a whitelist or blacklist, but you rarely see a warning. It does not get in the way so make sure it is turned on.
Go to the Control Panel and in Small icons view, click Security and Maintenance. Click Change Windows SmartScreen settings on the left and then select Get administrator approval...
Windows SmartScreen is also in the new Settings app, only it is an on/off switch rather than the three options in the Control Panel. It is in Privacy, General. Make sure it is turned on.
Nothing beats a good security program of course, but it is still worth checking these settings and making sure that they are turned on.