help!! my site on shared hosting keeps randomly falling over with this:

There has been a critical error on this website.
Learn more about troubleshooting WordPress.
A restart of the server or waiting a while fixes it, then it comes back a few days later... it got noticeably worse after migrating to a new host. id like to understand whether the database server is dying or WordPress cant reach it for some other reason, id love to understand the cause instead of just rebooting forever.
