The Mac is a very robust, reliable computer. They are not perfect, though. There are times when a Mac will not boot up. I hope this does not happen to you, but if it does then read this article listing several ways to get your data off the non-bootable Mac. The article covers Backups, Target Disk Mode, and M1 Macs.