A diode is a PN junction with p-type on one side and n-type on the other. When a positive voltage is applied to the p-type side it shrinks and overcomes the depletion zone, causing the current to flow from the p-type to the n-type side.
The PN junction diode is used as
When a PN junction diode is reverse biased