I recently learned about the build-in (hardware) watchdog functionality on raspberry pis to automatically reboot them when something got stuck.
This actually happens to me occasionally when the SSD cannot be written to any more (so far a reboot solved the problem).
Apparently the watchdog needs to be enabled and a watchdog daemon needs to be running - see, e.g., Running forever with the Raspberry Pi Hardware Watchdog
As I am running HAOS I see no way to do this myself and would hope the core team would see this to be a useful addition to HAOS.