Overnight crash 2 nights in a row

I have been running without any issues for 6 months, and the last two mornings I have woke to find home assistant has crashed, down powering the pi and I works again fine, how can I find out what caused the crash? so I can stop this happening. Thanks in advance for any advice.

Raspberry Pi…SD card failing?

Regardless, make backup now.

Does crash occur at same time. You may be able to look at history of devices ad look for abnormal data to determine time if crash.

HA is very stable and not normally crash for random cause. Crash in normally hardware related. You may watch memory to see if this increasing over time and out if memory cause crash. If you have unsupported integration that may cause this error so maybe disable any unsupported.afterbchhecking other items

EDIT
Just move install to new SD card.

Thanks for the tips,I do back up daily. But had no issues for the last 2 nights. Hopefully it might have been a network glitch why I could not access it.