The function of the diode is to provide only 1 pave for current flow. Since the voltage after a step down from the transformer is AC, the diode is essential to change this AC voltage to DC voltage.
To have a better idea
The graph of the output voltage after step down is actually a sine curve...