Microsoft has finally worked out how to allow us to change our domain names after YEARS of waiting! You can now correct it if your company has changed names or if you have CompanyName1.sharepoint.com, CompanyName4.sharepoint.com, etc. because you were unaware of the implications at the time.
However, there are many factors to take into account before accomplishing this, and it necessitates running PowerShell scripts. With regard to the process, Microsoft has published excellent guidelines that include a section on Low, Medium, and High impact locations. Before making this adjustment, kindly read and comprehend everything.
When you first signed up for Microsoft 365, you created an onmicrosoft.com domain. Even if you later added a custom domain, the original onmicrosoft.com domain is used for all your SharePoint and OneDrive URLs.
https://learn.microsoft.com/en-us/sharepoint/change-your-sharepoint-domain-name