Repair anvils with iron ingots or damage them with obsidian, via crafting or by shift + right-clicking them.
Repair damaged or chipped anvils using iron ingots, or intentionally damage them using obsidian. Shift + Right-click placed anvils to modify them directly, or combine the items in a crafting table.