A light emitting diode, or LED, will light once current is applied to the part. A resistor and LED in series can be considered a simple circuit. Why use a resistor with an LED? A resistor can be used for current limitation. This resistor is called the ballast resistor. If the supplied voltage is equal to the LED voltage, a resistor will not be needed.
The following link will show examples of circuits with resistors and LEDs - Resistor for LED.
If you are exceeding the LED voltage, you will need a resistor to resist the additional voltage. When calculating the resistor value, you will need to know the voltage drop across the LED first. An example would be a 12V power supply for a 2V LED. With the voltage drop of 2V, you can determine the additional voltage is 10V above the LED value. If the current in the circuit is 200mA, we can now use Ohm’s Law to find the resistor value. With the additional 10V in the circuit and 200mA, the final result will be a 50 ohm resistor. Please note that the power rating for the resistor will take into effect. Power can be calculated as V^2/R, I^2xR, or VxR. In this case, the absolute minimum power rating for this resistor can be 2W, but should be doubled for reliability at 4W.
The following explains a little more on Ohm’s Law:
Please see this post on Ohm’s law calculations for further information:
We also have our LED Resistor Calculator if you would like to make faster calculations.