It can be done either by using vendors that have anvil shown whenever you mouseover them, or by using your own WoW toys or mounts with repair function included in them. Item repairing requires World of Warcraft gold to fix a broken armor piece or weapon. Price depends on the gear conditions.