LEDs are polarized components. Backward, they just don’t light on.
How to recognize the polarity of a LED?
So, the longest leg is connected to the Anode of the LED (the positive side).
But, when you cut the legs and the LED doesn’t light when it’s supposed to do, how can you tell if it’s backward or not?
Well, if you look through the transparent case, you can see 2 non symmetrical shapes.
The bigger and taller piece is always the cathode (the negative side).