Remember led diode always have specific voltage and current so you have to choose the correct resistance so the diode will work correctly.
To fine the correct resistor, we have first to subtract the voltage from the led diode that is in this case 3.5 so we subtract the power supply of 9v-3.5= 5.5volt
So after we have the correct volt now we use the ohms formula to fine the resistance value. Now that the diode also has 20mA so we divide 5.5 volt/ 20mA= to have the correct resistance of 275 ohms
In this case we use the current of the led diode in the entire circuit.
All of this circuit is create by Jenko022 on via youtube