I think I understand what the difference is for LDO vs non-LDO voltage regulators, which is than an LDO voltage regulator needs a smaller in vs out voltage difference. AKA a 5V LDO can regulate to 5V at 5.5V where a non-LDO would need 7V to regulate to 5V.
My question is, if you have a 24V power supply, and you need a 5V regulated supply, using a non-LDO will generate a lot of heat. If you use an LDO, will the power consumption be less?
No, the dissipated power will be the same. From the formula for power: P=U.I , where U=24-5=19V in both cases, current is the same in both cases => P(power) will be the same. If you want to eliminate heat, try using step-down(buck) converter, for example LM2576.