If you're reading this, your username is probably something like xXDarkHeroLordMaster66Zz (or something to that effect). That's alright! Changing it is super easy as long as you know where to look. I'll try to make it as simple as possible.
First of all, head over to minecraft.net/en-us/login and enter your account details. If you made your account using a Microsoft account, click the "Sign in with Microsoft" button just above the fields.
Now you've logged in, you might get asked to "Confirm your identity". These will be the questions you filled out when you created your account in the first place.
After confirming your secret answers, you will see a line labelled "Profile Information". Under this section, you will see your current username. Next to that, click "Change".
Now a box will slide down where you can enter a new name. Make sure you choose carefully, because you can only change it once every 30 days!
Once you click "Change Profile Name", that's it. Your name will be changed the next time you open the game!
Q: I changed my name by accident! Can someone steal my old name now?
A: Nope. Not for 37 days at least. So after 30 days, you still have a week before anyone else can claim it.
Q: My old username had my real name in it. Can it get removed from my history?
A: Yes. You can send a ticket here to get it removed. It might just take a while so be patient.