First off, I should probably state that changing your WordPress site's domain name is not a trivial matter. In fact, if your website is well established, it's not recommended. You could lose your rankings in search engines, as well as any inbound links from other websites. That said, there are perfectly legitimate reasons for changing the domain name for your WordPress site. If you're certain you need to change your domain, be sure to go about it correctly.
The first step is to purchase a new domain name from a domain name registrar like Namecheap or GoDaddy.
If your website is hosted on WordPress.com, you can actually register a domain name right inside your web hosting dashboard, so you don't have to bother with an outside domain registrar. Best of all, you can skip the next step as well, because they'll automatically configure your new domain name with the correct settings to connect to your website.
Here's a link to their support article on how to change the Site Address for a WordPress.com site.
If your site is hosted anywhere else, you'll need to follow their instructions to connect your new domain name to your website. Every hosting company has a slightly different process, but your host should have a support article detailing the specific steps for their platform.
Typically, this process involves changing the nameservers listed in the DNS record for your domain name. You may need to reach out to their support team to make sure you follow the specific process they require.
Okay, by now you should have purchased your new domain name, and correctly pointed it to the web server where your WordPress site is hosted.
The final step before actually changing your domain name is to ensure you've got a complete and current backup of your entire website. That way, if anything goes awry during the process, you can roll back your changes and start over.
Read: How to Backup Your WordPress Website
Okay, you're finally ready to change your domain name in WordPress!
Log into your WordPress dashboard, and go to the General > Settings screen.
Look for the two fields labeled: WordPress Address (URL) and Site Address (URL)
Type the new address into both of these fields, and Save Changes.
A word of warning... once you save your changes, you'll have to log into your WordPress dashboard again, because it will no longer be accessible from the original URL. If you change your WordPress Address without first changing the nameservers as mentioned above, your site will become inaccessible and you'll need to reach out to the support team for your web host to restore your site.
With that step complete, you should now be able to access your WordPress site from your new domain name!
But what about links within your existing posts and pages? You may have links or even image URLs that contain your original domain name. And those links will now be broken. Incorrect image URLs may result in your images no longer appearing on your site.
To correct this, install and activate the Better Search Replace plugin, and then follow the instructions to replace every instance of your original domain name with the new domain name.
When that's done, your WordPress site will now be fully accessible from your new domain name.
If this process sounds overwhelming, don't sweat it! You can hire a WordPress expert from Codeable who can handle the entire process for you in less than an hour.
I hope this helps, and that you're able to successfully change your domain name for your WordPress site!