See Apple's support document If your Mac starts up to a question mark - Apple Support in which it says that
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.
Follow the steps in that document:
If the question mark is persistent, and your Mac does not start up normally:
- Press and hold the power button on your Mac for up to 10 seconds, until your Mac turns off.
- Every Mac has a power button. On notebook computers that have Touch ID, press and hold Touch ID.
- Use Disk Utility to repair your startup disk. Follow the steps for a Mac with an Intel processor.
- If Disk Utility found no errors or repaired all errors, reinstall macOS.
- If you still need help, please contact Apple Support.