An anvil is useful in Minecraft to repair items without breaking the enchantment. An anvil can also combine the enchantments and rename items. An anvil is much more complicated than a crafting table, and it requires experience points (earned by completing tasks in the game, and by killing mobs) and materials in order to repair the respective item.
To repair or enchant an item, here are the steps on how to repair armour in Minecraft.
Step 1: Place the item you wish to repair in the very first slot.
Step 2: Place the sacrificed piece in the slot next to the first slot
For repairing, you place the repair book in the second slot. For other items, you place an ingredient (such as iron ingot to repair an iron sword) in the second slot.
The game calculates the cost of the repair and determines whether you have enough experience points (seen as the bottom bar below the hearts) to complete the repair. (This statement does not apply to Creative mode.) Repairing a sword is generally only desirable to preserve enchantments.
You can drop an anvil and inflict considerable damage on mobs and players (the anvil will not be damaged).
An armour is one of the more expensive items to craft, because it requires more iron than a complete set of iron armor. To craft an armour, place 3 blocks of iron along with the 3 iron ingots on the bottom horizontal row, and 1 iron ingot in the middle square. Then you have a total of 31 iron ingots (blocks are composed of 9 iron ingots apiece).