Instructions
Write the formula R = (VS - VL) / I, where R is the value of the resistor you will use, VS is the supply voltage, VL is the LED voltage and I is the LED current.
Find all the values required in the formula. For example, a circuit supplied by a 9-volt battery would have VS = 9. The manufacturer gives the LED values, but if these are unavailable, you can find them online. For a red LED, the voltage is usually 2.0 V. For all LEDs, the current is usually 20 milliamps (mA).
Plug the numbers into the formula and calculate the result. It is unlikely you will have a resistor of that exact value, so get as close as you can, rounding up to the next highest resistor you have.