Q:

Trying to regulate 24V from 24-30V 3A input

I am trying to convert 24-30V input to 24V 3A regulated output.  I tried using ti's 5A adjustable regulator LM338 but I faced heatsink problem which seems like impossible to keep cool while trying to supply that much.  Do I have to buy a DC/DC converter or is there any other 'diy' way of doing it? 
This regulator is going to be used for powering a water pump which requires 24V 3 Amps. 
Heat dissipation calculation: 
lm338 has a characteristic of 'Junction to Case, RθJC(top) 15.7°C/W'
The load will be dissipating 24v*3A=72 Watts of power, and the regulator will be dissipating (30v-24v)*3A = 18 Watts of power.  So total is 90 Watts. 
90*15.7= 1413°C seems too much isn't it? 

A:

You are partially correct with your calculations.   The load power has nothing to do with the power dissipation of the LM338. 
30V - 24V = 6V
6V \$\times\$ 3A = 18W 
$$P_D = \frac {T_{J\ Max} - T_A}{\theta_{JA}} $$
$$T_{J\ Max} = P_D \times \theta_{JA} + T_A $$
$$18W \times 22.9^{\circ}C/W + 20^{\circ}C = 412.2^{\circ}C $$
Assuming ambient temperature is \$20^{\circ}\$.  The maximum for the TO220 package is \$260^{\circ}C\$ (at least the one I reference).   So thermal shutdown. 
If you decrease input voltage to 27V.  You meet the minimum Input-to-output voltage differential.   The LM338 will not work below 27V to provide 24V.
To minimize losses and to keep parts cooler, it is best to operate linear regulators at the minimum input voltage. 
27V - 24V = 3V
3V \$\times\$ 3A = 9W 
$$9W \times 22.9^{\circ}C/W  + 20^{\circ}C = 226.1^{\circ}$$
Below \$260^{\circ}C\$, so this should work with a heatsink.   It will be hot and waste power, but it will work. 
LM338 datasheet

