How to Edit WordPress’s wp-config.php File Using cPanel
You can learn how to use cPanel properly in this guide, and how to edit the wp-config.php file without damaging your WordPress website.
The key file for every WordPress website is named as wp-config.php. It’s always located in the root folder of the website. Whenever you get a database connection error, you need to edit this file. You will locate it in the file manager much like the.htaccess package. But most people are confused and unable to locate the wp-config.php file. You should also be aware that this file includes certain authentications keys.
Since it contains important information, we do not recommend editing it without the backup of the file or the website.
You can find it in cPanel > File Manager menu > root folder of the WordPress installation:

There are several ways to edit edit wp-config.php file
1) Using cPanel File Manager menu > select the wp-config.php file > click on Code Editor:
First of all, you have to log into cPanel of your web hosting and open the file manager. You can find it in the files’ section.

I am using My Hostinger for demo, the icons will be totally different for different hosting but the options will be quite similar. Even the Siteground users may find it a little different.
But don’t worry, you can easily find the file manager. At some web hostings, it’s named only as Files. you can click on edit menu amd edit the file, save it.
WordPress PHP Memory Limit/Increase Memory Limit
2) Using FTP/SFTP (how to find and edit wp-config.php file)
Download the file to your device and use any text editor, like Notepad or TextEdit, to make the changes. Once done, you will need to reupload the file to the hosting account.