Ways to power an Arduino from 24 VDC
This is the most efficient solution, will provide good conversion rate but is a little bit more complex to do and also more expensive. Although you can find modules that are already soldered with components saving you the trouble of calculating everything.
This is less efficient, it basically acts as a regulated resistor, dissipating the power you don't use through heating. Only need 3 components usually, the voltage regulator and 2 capacitors and it is cheaper than 1.
Won't work for you, voltage divider is not regulated and depends on the load, thus the resulting voltage may vary.


For your case, I would buy a DC/DC buck converter module already assembled like this one.

Note there are also capacitor based voltage converters.