2 things, one of which has already been said
Get an SSD and a usb cable for it. Boot off that. Be aware that not all cables are the same (have a Google for usb 3 SSD cables for home assistant before you buy one). There’s a little song and dance you have to do to boot off ext SSD but it’s not hard and doesn’t take long (Google).
That combo will eliminate the SD card issues in the future. But you also need to look into the Google Drive backup add-on. Get that for when shit goes down.
With those two things you should be all set and eliminate this ever happening again. If it does you have a backup.
I don’t think I am, it’s Usenet and a VPN, and costs less than my Spotify Family account.