A filament has a lot of resistance toelectricity. Therefore as a result of this, the filament heats up and starts glowing, converting electrical energy to light energy. This is because of the Joule-effect, which means that resistances heat up when electricalcurrent runs through them.