There are several ways of reducing and preventing this form of corrosion.
* Electrically insulate the two metals from each other. If they are not in electrical contact, no galvanic coupling will occur.  This can be achieved by using non-conductive materials between metals of different electropotential. Piping can be isolated with a spool of pipe made of plastic materials, or made of metal material internally coated or lined. It is important that the spool be a sufficient length to be effective. For reasons of safety, this should not be attempted where an electrical earthing system uses the pipework for its ground or has equipotential bonding.
* Metal boats connected to a shore line electrical power feed  will normally have to have the hull connected to earth for safety reasons.  However the end of that earth connection is likely to be a copper rod buried within the marina, resulting in a steel-copper "battery" of about 0.5 V. Additionally, the hull of each boat is connected to the hull of all other boats, resulting in further "batteries" between propellers (which may be made of bronze) and steel hulls, which may cause corrosion of the expensive propellers. For such cases, the use of a galvanic isolator is essential, typically two semiconductor diodes in series, in parallel with two diodes conducting in the opposite direction (antiparallel). This device is inserted in the protective earth connection between the hull and the shoreline protective conductor. This prevents any current in the protective conductor while the applied voltage is less than 1.4 V (i.e. 0.7 V per diode), but allows a full current in the case of an electrical fault.  There will still be a very minor leakage of current through the diodes, which may result in slightly faster corrosion than normal.
* Ensure there is no contact with an electrolyte. This can be done by using water-repellent compounds such as greases, or by coating the metals with an impermeable protective layer, such as a suitable paint, varnish, or plastic. If it is not possible to coat both, the coating should be applied to the more noble, the material with higher potential. This is advisable because if the coating is applied only on the more active material, in case of damage to the coating there will be a large cathode area and a very small anode area, and for the exposed anodic area the corrosion rate will be correspondingly high.
* Using antioxidant paste is beneficial for preventing corrosion between copper and aluminium electrical connections.  The paste consists of a lower nobility metal than aluminium or copper.
* Choose metals that have similar electropotentials. The more closely matched the individual potentials, the smaller the potential difference and hence the smaller the galvanic current. Using the same metal for all construction is the easiest way of matching potentials.
* Electroplating or other plating can also help. This tends to use more noble metals that resist corrosion better. Chrome, nickel, silver and gold can all be used. Galvanizing with zinc protects the steel base metal by sacrificial anodic action. 
* Cathodic protection uses one or more sacrificial anodes made of a metal which is more active than the protected metal. Alloys of metals commonly used for sacrificial anodes include zinc, magnesium, and aluminium. This approach is commonplace in water heaters and many buried or immersed metallic structures.
* Cathodic protection can also be applied by connecting a direct current (DC) electrical power supply to oppose the corrosive galvanic current. (See .)