LEDs are basically diodes that emit light. This means that in addition to lighting up, they also permit current flow in one direction only.
How to tell the cathode (toward ground) leg of a diode.
Remember that Diodes are polar devices, they must be hooked up in the right direction. This means that you want to know which end is the cathode, and make sure that end is facing the negative in your circuit.
Look for the following:
- a larger piece inside the LED
- a flat edge on the rim of the LED
- a shorter leg (don’t rely on this if the LED isn’t new)
A schematic of an LED: