Go to the official Minecraft website
Sign in with your Microsoft account
Open your account profile settings
Find the Gamertag or Minecraft username section
Click the option to change your name
Enter your new name
Check that the name is available
Save the changes
Wait for the update to apply in Minecraft
If needed, log out and log back in to see the new name
