If your Mac starts up to a question mark
https://support.apple.com/en-us/HT204323
Booting to Recovery will not erase your memory.
Always advised to have a current backup plan in place—
3-2-1 Backup Strategy: three copies of your data, two different methods, and one offsite.
Boot clone https://discussions.apple.com/docs/DOC-10081
How to use Time Machine to back up or restore your Mac: https://support.apple.com/en-us/HT201250
Use DiskUtility Restore feature https://support.apple.com/guide/disk-utility/restore-a-disk-dskutl14062/mac
note: >System Preferences>Security & Privacy >Privacy>Full Disk Access
unlock the padlock, press the + button and add Disk Utility