Practical guide and verification
The resistor controls current approximately
A basic series-resistor calculation uses supply voltage, LED forward voltage and target current. The resistor drops the remaining voltage, but real LED forward voltage varies with device, current and temperature.
Power matters as well as resistance
After finding resistance, calculate resistor dissipation from current and voltage drop. A resistor should have suitable power margin rather than being selected only by its ohmic value.
Common mistake
Do not connect multiple parallel LEDs to one simple current-limiting resistor and assume they will share current evenly. Device variations can cause unequal current unless the circuit is designed for parallel operation.