A ventilator is a machine that supports breathing to get oxygen into the lungs, remove carbon dioxide (a waste gas that can be toxic) from the body, help the people to breathe easier and or breathe for people who have lost all ability to breathe on their own. The ventilator machine are mainly used in the hospitals.
The ventilator machine is often used for short periods, such as during surgery when you're under general anesthesia. The medicines used to induce anesthesia can disrupt normal breathing.
A ventilator machine helps make sure that you continue breathing during surgery and also may be used during a treatment for a serious lung disease or other condition that affecting normal breathing.