How does a bulb glow when a torch is switched on?

If your torch has an incandescent bulb in it, the resistance of the wire in the bulb generates enough heat that light is created.

If your torch has an LED bulb, the PN junction in the diode creates light when the diode is forward-biased.