My site on a managed WordPress plan 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 restoring a backup. I'd like to understand whether the database server is dying or WordPress can't reach it for some other reason. I'd love to understand the cause instead of just rebooting forever.