In the event of a loss of
cabin pressure (if you're over 15,000 feet altitude) in an
aircraft, everyone on board's ears will pop. But that's the least of the problems.
See, higher than that set altitude will give people less than 14psi of atmosphere to breathe. This could be bad. So the pilot will press a button in the cockpit to deploy oxygen masks from the ceiling of the cabin.
The masks consist of a yellow cup with a clear plastic tube leading into the tip, connected to a clear, plastic, deflated bag. To use this mask simply tug once on the tube, place the mask on your face, securing the elastic strap, and tightening when necessary. Even though oxygen is flowing, the bag won't necessarily inflate. If you have a child, put your mask on first, then assist the child.
The bag doesn't always inflate because this is a rebreather mask. An ambulance has a Nonrebreather mask (NRB) which gives you continuously new air. A rebreather mask needs to conserve oxygen for everyone else. The ones on airplanes vary in how much oxygen it gives you according to how much there is around you. If you're flying low, then there is enough air and the bag won't inflate. If you're at 38,000 feet, you'll need more air. The bag mixes the ambient air with what's coming from the tank. Also, if you're slow to take a breath, the bag functions as a reserve, holding the gas coming from the tank as storage until your next breath.
No, Fight Club fans, oxygen does not make you high, at least not as well as drugs. Catastrophic loss of pressure is bad, and can give you the bends/decompression sickness.
Once you are below 15,000 feet, you can take off the masks, unless the whole experience is making you hyperventilate or have an asthma attack.