The 3V lamp represents the load. Its power was calculated to 300mW so that the required current is 100mA.
W = V * I
W = 3 * 0.1
W = 0.3
R1 was calculated to allow the load current, 100mA.
First, we need to find the R1 voltage, in this case, it's the source voltage (5V) - Zener breakdown voltage (3V).
So R1 has a drop voltage of 2V. Knowing that V = I * R:
R = V / I (amperes)
R = 2 / 0.1
R = 20 Ohms
Note that the circuit will consume approximately 100mA even if the load is off.
Toggle the switch to see the current over the load and the zener diode.