Changing URL for WordPress

Recently, I have to change a URL for one of my WordPress websites. After a new domain name was pointed to the location of WP directory on my server, my website didn’t correctly show due to some elements still linked to the old URL. To fix this, I have to tell WordPress a new URL by putting these two lines in wp-config.php