It is tricky and easy to reset password on WSL2.

To do that, first of all, you need to set login as root by default:

1
ubuntu config --default-user root

Then change your password as root:

1
passwd <YOUR_USERNAME>

Change the password of root, of course:

1
passwd

In the end, change the default user of WSL2 back to your own username:

1
ubuntu config --default-user <YOUR_USERNAME>