Thermoregulation involves balancing heat production and heat loss to maintain a constant body temperature. Body temperature is affected by ambient temperature, activity level, digestion, and time of day or year. Endotherms internally regulate temperature through mechanisms like shivering, vasoconstriction, and brown fat metabolism. Ectotherms rely on external temperatures and behaviors like changing orientation. Hypothermia occurs when heat loss exceeds production, while hyperthermia is an excessive rise in core temperature. Both require warming or cooling treatments respectively.