The device functions by utilizing either compressed air or ultrasonic vibrations to break down liquid medication into tiny droplets, making them easy to inhale. A mouthpiece or mask is typically attached to the nebulizer machine, through which the patient breathes in the medicated mist.