you were breathing was probably albuterol, the same medicine used in
rescue inhalers, just in liquid form from a machine called a nebulizer. The albuterol opens constricted airways, which is why you couldn't breathe. Asthma is often compared to drowning without water.
If you're still having yellow mucus, you probably still have an infection. If you're still having breathing problems, especially at night, ask for a temporary rescue inhaler so you can try to avoid trips to the ER.