There is a standard reply for this specific issue:
• If your Mac starts up to a question mark - Apple Support
https://support.apple.com/en-us/HT204323
"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."
Two things, first.
[May not apply to M1 Apple Silicon.]
- If the question mark appears only momentarily before your Mac starts up normally:Reset NVRAM.
- Make sure that your preferred startup disk is selected in Startup Disk preferences.
• IF the question mark persists, follow these steps:
- Press and hold the power button on your Mac for up to 10 seconds, until your Mac turns off.
- Turn on your Mac and immediately press and hold Command (⌘) and R to start up from macOS Recovery.
- While in macOS Recovery, use Disk Utility to repair your startup disk.
- If Disk Utility found no errors or repaired all errors, reinstall macOS.
- If you still need help, please contact Apple Support.
(Published Date: May 03, 2021)
• Use macOS Recovery on a Mac with Apple Silicon (M1/M2) - Apple Support
https://support.apple.com/guide/mac-help/macos-recovery-a-mac-apple-silicon-mchl82829c17/mac
• How to repair a Mac disk with Disk Utility - Apple Support (note M1 Silicon* instructions)
https://support.apple.com/en-us/HT210898