If you're very specific about converting a 24V to 5V, I looked into DigiKey to find the right part for you.
The part that would be perfect for you that's in stock at DigiKey right now is called BA05CC0T-ND. Just look for that in the search box in Digikey.
And for your information, I will tell you the steps I did to find this part:
1.) go to digikey.com
2.) search for Voltage regulator in the search box
3.) there will be a bunch of categories but you need to look under Integrated Circuits and click Voltage Regulator - Linear
4.) there will be a table that you can use for filtering and what I did was towards the right, under the column Voltage Output, look for "5V", click it and then click Apply filter on the screen to the bottom left.
5.) the filter table will be reduced and then under the column Voltage Input, look for a range that has your input voltage requirement, in your case 24V. I clicked on 4~25V and then click Apply Filter again.
6.) the search result should be narrowed down pretty well and just look for one that looks the simplest, and of course in Stock. In this case, I chose the one that has the least number of pins.
There ya go, hope that helps.