Basic NPN bipolar junction transistor operation. The signal is switched by controlling power at the base of the transistor. I set up a simple square wave with 70% width. Voltages at both collector and base should be set properly to overcome the biases of the transistor and the load requirements of the LED.