A diode consists of two pieces of silicon each one of which has different infinitesimal impurities from other materials like indium, arsenic, gallium etc. which alter their electrical behavior
A diode allows electric current to pass throw it only in one direction (from cathode to anode).