Find a nametag in a dungeon, mineshaft, stronghold, fishing, or chest loot
Trade with a librarian villager for a nametag
Use an anvil
Place the nametag in the anvil
Rename the nametag if desired
Take the finished nametag from the output slot
Use the nametag on an anvil to rename it before applying it to a mob
Right-click or use the nametag on a mob while holding it to apply the name
