Correct, this will not work.
Ok, but you don't need 24V. You can use a simple small DC barrel jack transformer of 5V or 10V. Or three AA batteries.
To control the LED with Arduino you could use also a power transistor or mosfet, with the PWM pin of the Arduino. Check this link for example:
https://adam-meyer.com/arduino/TIP120
I think that the 3rd example is what you want to do, more or less:
