Transistor not triggering
You used a transistor as a switch, but made a wrong circuit. The correct circuit is: 



R1: This 2k2Ω resistor limits the current flowing into the base of the transistor. You can calculate the current at the base with the assumption base-emitter voltage is about 0.7v.

R2: This 330 Ω resistor limits the current through the LED to prevent the LED from burning out. You can calculate the current at the LED with the assumption drop voltage of the LED is about 1.8v.

Q1: This is a common NPN transistor.

Simply speaking,


when V input near 5V, transistor ON, collector voltage near 0v, LED on.
when V input near 0V, transistor OFF, collector voltage near 5V, LED off.