A LED requires a “current-limiting” resistor to keep it from frying. I use a 1K resistor with all my LEDs, and it seems to work pretty well. You will get a brighter light with a smaller resistor, and a dimmer light with a larger one. Don’t “test” a LED by hooking it up “just for a moment” without a resistor. You will then have a Darkness Emitting Diode, or DED.
LEDs must be wired with the correct polarity. If you wire them backwards, they won’t work at all on DCC. They’ll work OK on AC, though, because half of the cycle is always right for the LED.
I like the golden white, sunny white or yellow white LEDs a lot, by the way. They make great headlights.