i felt free to modify your circuit because there are few mistakes. not sure where you get 430mA from what i see, only thing powered by regulator is one IC and my guess is that this does not need so much current (probably few mA at best). note 430mA is 0.430A and power dissipated by regulator is
P=(Vin-Vout)*I
in this case (assuming that huge 0.43A current) we would get:
P=(24-5)*0.43=8.17W
That is quite a lot. One of my soldering irons is 8W...
Not sure where others came up with 10W, that can't be right.
The high current in this circuit does NOT go through regulator, it goes through driver UDN2981.
Also voltage drop across driver output is much smaller than what you see across voltage regulator so dissipated power is much lower.
if high current was expected from voltage regulator:
Linear regulators are good when voltage difference is small (but greater than min. voltage drop which for many regulators is 2.5V). if difference is greater, like in this case (19V), and current is considerable (such as 0.43A), use of switching regulator would be much better idea (same footprint and no heatsink even for max current).
here is example of 7805 substitute that uses switching mode:
https://www.mouser.com/ProductDetai...15-W36-C/?qs=uJpRT2lXVNWg5/3Kq428yerU/ojeO/N1
but... i just notice that this MCU is PIC16F690. this is nanowatt device - it works on ... well, almost air (next to nothing). you definitely don't need heatsink on voltage regulator for load as small as that. good old 7805 will be just fine here.
UDN2981 is powered by 24V. so when MCU output is high, corresponding output will turn on and provide 24V.
for example you can connect load directly to output terminals (3 and 4 for first output, 5 and 6 for second output).