Go to the official Minecraft website
Sign in to your Microsoft account
Open your account profile settings
Find the Minecraft username or gamertag section
Click the option to change your username
Enter your new username
Check that the username is available
Save the changes
Wait for the change to update in Minecraft
If you play on Java Edition, use your Minecraft profile name settings
If you play on Bedrock Edition, change your Xbox gamertag instead
