Concept:
Power relation:
\[
P = VI
\]
Series resistor limits current through the LED. The remaining voltage appears across the resistor.
Step 1: Find voltage across LED.}
Given LED power rating
\[
P = 2\times10^{-3} \,W
\]
Current through LED
\[
i = 0.5\,mA = 0.5\times10^{-3} A
\]
\[
V_{LED} = \frac{P}{i}
\]
\[
V_{LED} = \frac{2\times10^{-3}}{0.5\times10^{-3}}
\]
\[
V_{LED} = 4V
\]
Step 2: Find voltage across series resistor.}
Supply voltage
\[
V = 5V
\]
\[
V = V_{Rs} + V_{LED}
\]
\[
5 = V_{Rs} + 4
\]
\[
V_{Rs} = 1V
\]
Step 3: Find required resistance.}
\[
V_{Rs} = iR_s
\]
\[
1 = 0.5\times10^{-3} R_s
\]
\[
R_s = 2\Omega
\]
Final Result
\[
R_s = 2\Omega
\]