The purpose of a resistor is to allow a precise amount of resistance to flow into a circuit. Resistors are small electronic components built of carbon or metal wire. They are made to remain stable and maintain a proper resistance value in a varying range of conditions.
Resistors do not produce any light, but due to the electric power coursing through them, they do produce heat. Sometimes a resistor is used for the specific purpose of producing usable heat, but most often they are only used to control the amount of energy flow. Resistors come in a range of values, each capable of producing a very specific amount of resistance.