Diode is a semiconductor device made by joining a p and n type semiconductor material. It allows current to flow in one direction only. Before current can flow inside a diode, it requires a minimum threshold voltage to turn it on. This depends on the type of semiconductor base material used. For silicon the threshold voltage will be about 0.7V and for germanium, about 0.3V.
The video below show the simulation of how a rectifier diode can be used as a switch. I will be using EasyEDA, a free EDA tool. It is a powerful tool and can be downloaded for the desktop version. It also works online.