

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 think I’m a step behind you. I use Uptime Kuma for monitoring and it worked really well. Just have it running on a pi separate from my main machine.
I worked out how to get it sending me emails when things are down and up, and now my email inbox is a fucking hot mess of notifications.
So I’ve just this weekend integrated it into Home Assistant and set it to notify me when things are down for 5 minutes or more.
My next step was going to be finding some way of integrating Portainer into Home Assistant so I can restart stopped containers, and maybe Proxmox so I can reboot VMs from HA. Not sure it’s possible yet though.
Ultimately I want to have HA send me a notification with actionable buttons with “reboot container” and “reboot VM” which, when pressed, will sort the issue out.
However this will not help when one of my drives goes down. They’re HDDs plugged in by USB3 which isn’t great and my server is behind the coat rack so sometimes the kids just throw their coats on and it falls onto my server, which then heats up and goes silly.