Homeostasis involves balancing internal regulation and external adaptation. Regulation is more energetically costly than conforming to environmental conditions. Thermoregulation controls an animal's temperature through conduction, convection, radiation, and evaporation. Endotherms generate their own body heat through metabolic processes while ectotherms rely on external temperatures. While endothermy allows for activity in more environments, it requires more energy intake than ectothermy. Osmoregulation maintains the salt and water balance in organisms through mechanisms like gills, kidneys, and specialized epithelia that filter different nitrogenous wastes like ammonia, urea, and uric acid depending on the animal.