Go to the official Minecraft website
Sign in to your Microsoft account
Open your account profile
Find the Gamertag or Minecraft username section
Select the option to change your name
Enter your new username
Check availability if prompted
Save the changes
Wait for the update to sync across Minecraft services
Note that Java Edition and Bedrock Edition use different name systems
Note that Java Edition name changes are done through the Minecraft website
Note that Bedrock Edition name changes are done through your Xbox Gamertag
Note that name changes may have a cooldown period before you can change it again
