Light emitting diode:
The resistance required is as follows: R = (U_power - U_led) / I_max
Example a LED with voltage drop of Uled=1.2V and a max current of I_max=0,020A (20mA) to be powered by a 5V DC source needs:
R = (5-1.2)/.02 = 190 ohm
You then connect a 190 ohm resistance in series with the LED to make it work.