Galvanic or dissimilar metal Corrosion is a electrochemical process where one material corrodes when comes in contact with another material. You can check more about Galvanic corrosion here. Galvanic corrosion can be prevented through following methods.
Insulation of dissimilar metals
Presence of conductive media between two metals is primary requirement for galvanic corrosion. Where ever possible insulating dissimilar metals can completely stop electrochemical process or corrosion.
Selection of materials closer in galvanic series
Selection of material shall be done based on anodic index value. Lower the difference in anodic index values, higher will be galvanic corrosion resistance. You can refer Anodic Index table here.
Sacrificial or Protective Metallic Coating
More anodic metallic coatings can provide sacrificial galvanic corrosion protection to the base material.
As a result of higher anodic index of coating, galvanic corrosion will start from metalic coating. In another words metalic coating sacrifices itself to protect the base material.
One of the advantage of sacrificial coating is : Even damaged coating protects the base material.
Extent of corrosion protection depends on coating material and thickness. For example, 12 micron zinc plating over steel will provide more corrosion resistance compared to 8 micron coating.
Size of Cathode and Anode in dissimilar Metals
Non Sacrificial Metallic and non metallic coating
Non-Sacrificial coatings such as powder-coating or paints works as a barrier and reduce galvanic corrosion. These Coatings are not as effective as sacrificial coatings.