When you want higher currents or you want to better handle LEDS with higher turn on voltages then you need a driver between the GPIO pin and the LED. The driver can be a bipolar transistor or a MOSFET transistor.
You can find simple schematics on the web for both of these. Basically the GPIO drives either the base (bipolar) or the gate (MOSFET). The emitter (bipolar) or source (MOSFET connects to 0V, and the LED + current limiting resistor goes to your power supply (e.g. 5V or 9V). In the biploar case you need a resistor between the GPIO and the base to et how much current is fed into the transistor to switch it on. This isn't needed for the MOSFET case.
If you only want 20mA LED current then the biploar using just about any npn transistor may be easiest for you. If you want to drive powerful LEDS with much higher currents then the MOSFET method has many advantages.
I think... the 20mA number on LED is like their max rating... not what will get them lit. Here's a calculator I use all the time... you can put in btidey's suggestion of 10 ma, and the details about the LED and the 3.3V of the pin and it'll calculate the resistor you need.
http://ledcalc.com/
w/ GUI Admin Client, Drag & Drop File Manager, OTA Built-In, Access Point Manager,
Performance Metrics, Web Socket Comms, App API, All running on ESP8266...
Even usable on ESP-01S --- Please check it out!
https://inqonthat.com/inqportal-the-three-line-promise/
https://InqOnThat.com/inqportal