In this circuit we used a 1M ohm resistor, a light dependent resistor (LDR), and an LED. This simply works on the principle of the light depending resistor. When a light is not incident on the LDR then the resistance of the LDR is very high around the range of 1M ohm but when we illuminate it with the light then resistance of the light decrease rapidly.
We know that if two resistors are in series and we apply a DC Voltage to it then the value of the voltage across each resistor is directly proportional to the value of the resistance of that resistor. Here when there is no light then resistance of LDR is high hence the voltage across it will be more. Due to this LED will glow. When there is light then the resistance of LDR decreases and voltage across it will also reduced. Now LED will not glow due to low voltage.
Tip: When you are going to solder the LED keep some distance between LED and LDR so that when LED glows it will not strike on the LDR.