From 24V to 5V DC voltage regulator

maybe this schematics will help you i tried all of them and working. but best is MC34063