TL431 LDO series pass transister heating up
Dropping 24 v down to 5v is very inefficient, most of the input power will end up as heat in your series pass element, regardless of its part number. 

150mA at nearly 20v drop is nearly 3 watts. If the transistor is getting too hot, use a larger heatsink, or a lower input voltage.

If you are stuck with using an input voltage at the top end of your range, then putting a series resistor before the transistor would shift some of the dissipation away from it, to allow you to use the existing heatsink. This does not affect the output regulation, that's still controlled by the transistor/431. You could halve the dissipation by dropping 9v in this way, which would need a series resistor of 9v/150mA = 60ohms. Of course, you'd need to use a resistor that could dissipate at least 1.5watts.

A better way that does not sacrifice the ability to work from lower input voltages would be to use a dropper transistor on a different heatsink, biassed from a resistive divider such that it splits the voltage drop across both transistors, to equalise their heat generation.

What we tend to do these days is to use a buck switching regulator, which loses far less heat, by drawing only the power needed from the power supply, not the full current.