Calculate the current-limiting resistor for an LED: R = (V_source − V_LED) / I. Also shows power dissipated.
R = (9 − 2) / 0.02 = 350.0 Ω