The purpose of a diode is to block current from flowing in one direction Diodes are typically used to protect a circuit if the power source is connected in the wrong direction.
A simple diode allows current to flow through unimpeded in one direction, but completely blocks any flow in the other direction. However, there are other types of diodes, such as semiconductor diodes, that block current flow in both directions unless there is a certain amount of current.
Diodes vary in both physical size and voltage capacity. It is important to use a diode with an adequate capacity so that the circuit will function as intended.