To change the username in Windows 11, follow these steps:
Click on the Start button and select the Settings icon (gear icon) from the left-hand side menu.
In the Settings menu, select "Accounts."
From the "Accounts" menu, select "Your info" from the left-hand side menu.
Click on the "Manage my Microsoft Account" link. This will open your Microsoft account page in your web browser.
Sign in to your Microsoft account if prompted.
Click on the "More actions" button (three dots) located at the top right corner of the page.
Select "Edit Profile" from the drop-down menu.
On the "Edit profile" page, click on the "Edit name" button.
Enter your desired new username in the "First name" and "Last name" fields.
Click the "Save" button to confirm your new username.
Wait for a few minutes, and the new username will automatically sync with your Windows 11 device.
That's it! Your Windows 11 username has now been changed.