Get a nametag from fishing, dungeons, chests, or trading with librarian villagers
Place an anvil on the ground
Put the nametag in the first anvil slot
Type the name you want
Take the renamed nametag from the result slot
Hold the renamed nametag in your hand
Right-click the nametag on the mob you want to name
Use the nametag on a mob that can be named
If needed, put the mob in a safe place first
Check that the name appears above the mob
