The first potentiomentr is a photo resistor. The second is for setting up a scheme. When light is on the photoresistor its resistense goes down and the fitst transistor opens. When the first trnsistor is closed, the second is open and diode lights up,