the hypothalamus is the answer.
Your hypothalamus, a structure deep in your brain, acts as your body's smart control coordinating center. Its main function is to keep your body in a stable state called homeostasis. It does its job by directly influencing your autonomic nervous system or by managing hormones.
hope this helps!! have a good day, love! :)