If your Mac starts up to a question mark
A folder with a flashing question mark means that your startup disk is no longer available or doesn't contain a working Mac operating system.

Turn off your Mac
Press and hold the power button on your Mac for up to 10 seconds, until your Mac turns off.
Start up from macOS Recovery
To start up from macOS Recovery, press the power button to turn on your Mac, then immediately press and hold these two keys until you see an Apple logo or other image: Command (⌘) and R.
When in macOS Recovery, your Mac shows a list of utilities, including Disk Utility:

Use Disk Utility to repair your startup disk
Select Disk Utility from the list in macOS Recovery, then click Continue and follow the steps to repair your startup disk with Disk Utility. These steps also describe what to do if Disk Utility can't repair your startup disk, or Disk Utility doesn't see your startup disk.
When done, restart your Mac: choose Apple menu > Restart.
Reinstall macOS, if necessary
If the question mark returns after restarting your Mac, repeat steps 1 and 2 to turn off your Mac and start up again from macOS Recovery. Then follow the steps to reinstall macOS.
If you need help
Learn what to do if you can't start up from macOS Recovery.
If the question mark isn't persistent, but appears only briefly before your Mac starts up, make sure that your startup disk is selected in Startup Disk settings. If that doesn't help, reset NVRAM and check the setting again.
If you still need help, please contact Apple Support.