Try a [https://support.apple.com/en-us/HT204063|NVRAM reset] for this.
"Shut down your Mac, then turn it on and immediately hold down these four keys together: Option, Command, P, and R. Keep holding the keys for about 20 seconds, during which your Mac might appear to restart. (If you have a Mac that plays a startup sound when you turn it on, you can release the keys after the second startup sound.)
Option+Command+P+R
When your Mac finishes starting up, you might want to open System Preferences and adjust settings that have been reset, such as sound volume, display resolution, startup disk selection, or time zone." Source : Apple
If this does not work you might have a hardware problem