The diode is placed across a relay coil that is powered by DC, to absorb voltage spikes generated by the coil inductance when the current through the coil is shut off. Without this diode, the high voltage spike generated by the collapsing magnetic field of the coil ("inductive kickback") can damage solid state components, particularly a transistor or other semiconductor used to control the relay coil.

The diode is installed so it is normally reverse biased (cathode to the positive end of the coil). The voltage generated by the inductive kickback will be of the opposite polarity, and will cause the diode to conduct, absorbing the spike. I usually use a diode with a PIV rating at least 5X the applied coil voltage. Something in the 1N400x series is suitable for most situations.