Every few hours, Home Assistant loses it's internet connection

I would start here: How to Troubleshoot Raspberry Pi Crashing.

And don’t skip the hardware bits - power and SD card issues are common.