In warm-blooded animals, when the ambient temperature is higher than body temperature, the body's energy will be spent on cooling.
It's simple, any muscle, any organ emit heat during its work. Our brain emits a lot of heat. In order to stop generating heat, you will have to stop all these processes: the work of the heart, respiration, the work of the brain, intestines, and others.
Roughly speaking, the body is an engine that, like others, cannot have 100% Efficiency, part of the mechanical energy is converted into heat. The body either uses this energy for heating, or gets rid of it by cooling through sweat.
Cold-blooded people have a slightly different way, they do not have an active thermoregulation system. Their body temperature is slightly higher (due to heating in the sun or muscle work) than the ambient temperature. The higher the temperature - the higher the activity, the lower - the slowness, lethargy, suspended animation. They do not experience the same feeling of cold as warm-blooded ones.
In addition, large cold-blooded ones have "inertial homeothermy" - they maintain temperature due to their large body size, keeping warm inside as long as possible.
In terms of energy, cold-blooded people consume and spend less energy. Warm-blooded people have to eat more often and more, run so as not to freeze, wear wool or feathers, stock up on subcutaneous fat. But they remain active regardless of temperature.
In every millisecond, the body's cells decide whether to store the energy obtained as a result of the chain of oxidative reactions (cellular respiration) in order to use it in the future to synthesize the necessary substances, or spend this energy to generate heat. Depending on the conditions, they can either save everything or spend everything on heating. So yes, the thermoregulation system is very flexible.