You may change your in-game nickname via your Profile in the in-game Menu > Edit Info > Edit Username.
Please note that there is a cooldown period of 72 hours after you have changed your nickname. If you have already changed your nickname beforehand, please kindly wait for the cooldown period to be over before attempting to change it again.
Please note that your in-game nickname is different from your HoYoverse Account Username.