First you get some materials: 3 Iron Blocks, and 4 iron ingots for an anvil that will be really important.
Name tags are found in dungeons and mineshafts.
After you’ve got your name tag and anvil, place the anvil down.
Now right-click into the anvil, and take the name tag and place it in the anvil like this
Now on the top bar, delete the word “name tag” and replace it with whatever you want to name your animal/mob.
Then take the other name tag named what you wanted out of the anvil, and pull it down to your inventory.
Now go to the mob/animal you want, hold the name tag and right click the animal. Done! You’ve now named an animal on creative.