An “Error Establishing a Database Connection” message is usually caused by incorrect database credentials, a database server issue, or temporary hosting problems. I’d recommend checking the wp-config.php database name, username, password, and host first. You can also contact your hosting provider to confirm that the MySQL/MariaDB server is running properly.
If you have a recent backup, it’s also a good idea to keep it available before making any major changes. Hopefully, checking these points will get your WordPress site back online quickly!