Hello,
There are the following reasons to occur this error.
1 Incorrect database login credentials
2 Check if MySQL server is up and running
First, you need to check in WP-config file, which login credentials have you set. You need to login through this credentials or you need to set the new login credentials in WP-config file.
Second one, you need to check MySQL server is running and up. If you are on shared Host, you can contact your Web Hosting provider and ask them if their MySQL server is responsive. If you own VPS or Dedicated server, you need to check the MySql service is running or not.
Regards,
Sagar