For changing name on twitter(X) just follow these simple steps:
Firstly Open your twitter id in the app or on the website.
Then click on the profile which is on top left.
When it opens then select profile.
When the profile is open then click on the edit profile button.
When it opens there is an option to name their type your new name.
Then click on save.