The part of your brain responsible for controlling this balance is called the medulla oblongata. It’s located near the bottom of the brain near your spinal cord and it controls involuntary functions, which are the things your body does to survive that you cannot control. That includes vomiting, blood pressure, and heart beats. Breathing gets controlled inside the medulla’s respiratory center, which houses receptors that detect when levels of carbon dioxide are too high in the blood. All of this happens automatically, so that even when you are sleeping the muscles responsible for inhaling and exhaling still operate without you controlling them.