DISCLAIMER: Potterworld or Droobledore LLC is not in any way affiliated with Mojang AB, J.K. Rowling, Warner Brothers or any company, copyright or trademark.
To name your pet, you can do the command "/pet name <the name you want to set it to>" in the chat. You can also use colour codes to colour the name of the pet by putting a & in front of a number or letter that corresponds to a colour. You can view a list of colour codes here: https://htmlcolorcodes.com/minecraft-color-codes/.
If you have any further questions, feel free to reply here or create a ticket in-game with the "/t create" command.