Does my IR LED need a ground?
You can have the GPIO drive low to light the LED OR drive high to light the LED, depending on how you connect the LED.
Some I/O technologies can drive a low with more current, so connecting the LED to VCC (+5V) was preferred. This is generally not the case for modern technologies, the low and high current are usually about the same. Some older designers still have habits from the old days and tend to connect LEDs to VCC.
If you need a transistor driver, a low side switch is often easier to make. For a low side switch, the LED is connected to VCC.



simulate this circuit &ndash; Schematic created using CircuitLab