Oxidation (and reduction) are literally electron flows.
Oxidation is a loss of electrons and reduction is a gain of electrons.
Since the oxidizing material is the anode in this (oxidation "circuit") you can connect a "sacrificial anode" to the material you want to preserve and the electrons will flow from that instead of the (material you want to save).
We have sacrificial anodes connected to our underground propane tank:
http://www.pettank.com/wp-content/uploads/2016/03/cathode-pr...
... which means a bag of magnesium does all the rusting instead of the tank they are connected to.