Tj = Pd(Θjc + Θcs + Θsa) + Ta
where:
Tj = junction temperature, °C
Pd = power dissipation, W
Θjc = junction thermal resistance, °C/W
Θcs = insulator thermal resistance, °C/W
Θsa = heat sink thermal resistance, °C/W
Ta = ambient temperature, °C
You can say Θja = Θjc + Θcs + Θsa, where Θja = junction to ambient, °C/W and then it gets simplified to :
Tj = Pd (Θja) + Ta
This Tj must be below the regulator's maximum temperature (ex 125c or 150c) otherwise the chip will break.
Let's take an example,
1. A LM1085 linear regulator (fixed 5v version) :
https://www.digikey.com/en/products/detail/texas-instruments/LM1085IT-5-0-NOPB/3635642. some random thermal paste (let's say it has 0.1 C/w thermal resistance)
3. a basic TO-220 heatsink :
https://www.digikey.com/en/products/detail/assmann-wsw-components/V6560Y/3511467The LM1085 has these specs :
https://www.ti.com/lit/ds/symlink/lm1085.pdf (page 4)
RθJA Junction-to-ambient thermal resistance 40.6
RθJC(top) Junction-to-case (top) thermal resistance 43.0
RθJB Junction-to-board thermal resistance 23.1
ψJT Junction-to-top characterization parameter 9.9
ψJB Junction-to-board characterization parameter 22.1
RθJC(bot) Junction-to-case (bottom) thermal resistance 0.7
The heatsink has a thermal resistance of
7C/w with natural airflow, no extra fans.
So let's say you need to power it with 12v and it produces 5v and you need up to 1A of current. This means the power dissipated by the regulator will be approximately P = ( 12v - 5v ) x 1 A = 7 watts .
So without a heatsink, we can use the thermal resistance junction to ambient to estimate how hot it would get :
Tj = 7w ( 40.6 + 0.7) + 30c (ambient) = 319c ... so obviously not gonna work.
But with heatsink :
Tj = 7w ( 7c/w for heatsink + 0.1c/w thermal paste + 0.7c/w junction-case) + 30c = 54.6 + 30 = 84.6 C ... which is below 125c so it's fine.
There are fancier heatsinks, like for example this one is rated 2.6c/w at natural airflow:
https://www.digikey.com/en/products/detail/aavid-thermal-division-of-boyd-corporation/530002B02500G/1216384The datasheet of LM1085 goes through explanations in section 10.3 (page 20) and even has the formula above.