Changing the URL is required in two cases: if the domain name of the site changes or if you need to change the HTTP protocol to HTTPS.
Editing the address is done manually, so you need to go to the root directory of your site on the hosting (folder public_html).
First, you will need to edit the config.php file, which is highlighted in blue in the image. Then navigate to the folder named 'admin', where you will also find the config.php file.
In those files, edit the lines that are highlighted in the screenshot below, depending on your goal (change the protocol in the address or the domain name).
After changing the address in both configuration files your site will be displayed correctly.