A diode is like a check valve for water. It only lets the electricity flow one way through it.