Prevention of corrosion can be done in the following ways :
1. By painting of the metal
The corrosion of a metal can be prevented simply by painting the metal surface by grease or varnish which form a protective layer on the surface of the metal The metal is, thus, protected from moisture and air.
Some metals form their own layer of protection. For example, when zinc is left exposed to the atmosphere, it combines with the oxygen of air to form a layer of zinc oxide over its surface. This oxide layer does not allow air to go into the interior of the metal Thus, zinc is protected from corrosion by its own protective layer.
3. By coating iron with zinc
Rusting of iron can be effectively prevented by coating iron with zinc. The layer of zinc does not allow iron to come in contact with air and moisture. If the zinc gets scratched at a place, the two metals form an electrochemical (galvanic) cell in the presence of moisture. Since zinc is more electropositive or more reactive than iron, zinc forms zinc ions and hence protects iron from rusting. The zinc-coated iron is called galvanized iron (GI) because iron and zinc form a mini-galvanic cell to prevent the rusting of iron.
Iron cannot be galvanized with copper. This is because copper is less electropositive than iron. Hence, even a slight scratching on copper coating can start the oxidation (corrosion) of iron.
4. Cathodic protection
The more reactive metals are more corrosion-prone. A corrosion-prone metal is connected to a bar of another metal that is even more prone to corrosion. In other words, the metal to be protected from corrosion is connected to a more reactive metal. Electrons flow from the more reactive metal to the less reactive metal (metal to be protected).
Thus, the metal to be protected becomes the cathode and the more reactive metal becomes the anode. In this way, the two metals form an electrochemical (galvanic) cell. Thus, the oxidation of the metal is prevented. For example, the pipelines under the earth are protected from corrosion by connecting them to a more reactive metal. Pieces of a more electropositive metal such as magnesium are buried in the earth and connected to the pipelines (iron) by a wire.