24 V led
As you are using dc, the led will be bright enough at a 10 to 15 mA current.
Most people always seem to go for the maximum current (20 to 30 mA) of the LED.
IMO it reduces the reliability
Go for a 1k8 (1800 ohms) resistor rated at 1 Watt.
It is good practise to put a small diode in antiparrallel with the LED in case of reverse polarity which may damage the led.
1N914, 1N4148 etc.
At my YouTube channel (RODALCO2007) I have a few LED clips for single and multi LED lamps for 110 V dc and 240 Volts AC.
They show you where the parts go.
In your 24 volt DC case the resistor value is different as stated above.
I'm at the work computer which doesn't allowe me access to YouTube.
if you are interested i can post the link later today.
The different colour led's have different voltage drop across them, from about 1.7 (red) to 3.3 (blue) Volts.
With above resistor you should have no problems whatsoever.