Domestic electricity is supplied as alternating current; the direction of the current changes rapidly and repeatedly as the supply voltage cycles from positive to negative.
A rectifier circuit can be used to change an alternating voltage to a smooth direct circuit.
A diode is used in the rectifier circuit to allow current to flow in only on direction, the capacitor smooths the voltage and becomes almost direct voltage of constant value.
The ripple in the voltage can be kept small by making the timeconstant of the circuit much greater than the period of the alternating voltage.