A simple AND gate logic when both the inputs are on the led glow otherwise the led won't glow try it yourself.
Note: Resistor which is connected in series with the led is used to limit the current through the LED if you remove the Resistor it will burn the LED. Try it yourself.