Use a Grindstone to remove all non-curse enchantments from an item
Place the enchanted item in one input slot of the Grindstone
Take the repaired item from the output slot
Use an Anvil and a different item if you want to replace enchantments instead of removing them
Curse enchantments cannot be removed with a Grindstone
