How to fix: I cannot install an application because it is an “unidentified developer.”

First, please check in System Preferences, Security & Privacy to see if you can unblock the app. You will need admin privileges to unlock the padlock to open the app:

If the app is not listed, the app might be protected by macOS Gatekeeper. Gatekeeper is a built-in security software that prevents unsigned and non-notarized apps from running/installing on your Mac. If you are certain that an app you want to install is from a trustworthy source and hasn’t been tampered with, you can remove the flag that is preventing the application from running.
WARNING. This terminal command should only be used for trusted applications. This command removes the quarantine flag that is used by macOS Gatekeeper that prevents the unsigned, unidentified developer’s app from running.
xattr -d -r com.apple.quarantine <app-path>