Ok, you're going to need to give us more to work on here...
Ie, I could be assuming the Pi has ethernet cable to the router and you're trying to access it via a desktop PC which is also cabled to the router? I'm guessing at least one of those assumptions are wrong...
Are you trying to access it from a webpage, or the Home Assistant app?
First up, how comfortable are you with command line? I'd run a continuous ping to the Pi and just see what happens there first...if that's flaking out, your network or Pi has issues and you need to fix that before anything else.
If you're accessing the Pi from a phone, is it only connected to the local wifi or are you also connected to a VPN, or does the phone keep auto-connecting to a nearby Starbucks, etc...