A Light Emitting Diode (LED) is a diode (obviously) that emits light of a single specific frequency (color) when forward-biased. This means that the diode is passing current (in the direction of the arrow in the symbol) as opposed to blocking it. The brightness is typically a function of current, but is not linear to current - in other words if 300 mA produces full brightness, 150 mA will produce less than half brightness. Also notice that LEDs being diodes only pass current in one direction, so we typically want to use DC to power them. You can use AC in certain scenarios (easily producing yellow from a R/G diode), but that's for post #2.
Just like a regular diode, an LED will always have a voltage drop across it when forward biased. This is a known value that does not change (at least as far as we're concerned) with respect to current. It is known by many names, including "forward bias voltage", "built-in voltage", etc., and is typically in the range of 1.5 to 2.0 volts (CORRECTED 11/8/11 @ 18:33).
That being said, what we care about is current through the LED. Based on our supply voltage and the LED's built-in voltage, we need to select a resistor to put in series with the LED such that the current flowing through the LED is as close to BUT NOT EXCEEDING the current rating of the LED. Too much will fry it, too little will produce a dim light.
To calculate the ideal resistor value, use the following formula where Vs is the supply voltage, Vd is the LED's built-in voltage (drop, in Volts), i is the LED's maximum rated current (in Amperes or "Amps"), and R is the resistor value (in Ohms).
R = (Vs - Vd) / i
Once you calculate that, you need to find the next HIGHEST standard resistor value as found below.
http://ecee.colorado.edu/~mccl...resistorsandcaps.pdf To determine what power rating of resistor you need (1/8 W, 1/4 W, etc.) you need the value of the standard resistor you've chosen above and the two voltages (Vd and Vs) to plug into the following formula.
P = ((Vs - Vd)^2) / R
Yes, that's a "square" - one way to calculate electrical power dissipated by a resistor is the voltage across the resistor (equal to "Vs - Vd") squared, divided by the resistance. See
this for more iterations of Ohm's Law. Anyway - just like when sizing the resistor, you need to find the next highest power rating for the resistor. If it works out to .23 Watts, then a 1/4 (0.25) Watt resistor will work just fine.
Those are the basic tools you need - how to calculate the desired resistor value based on your supply voltage, and how to calculate the resistor power rating after that.