The first one works because during a bronchoconstriction attack your bronchioli have a reduced diameter and therefore airflow is reduced, more air is retained inside the alveoli instead of flowing through the rest of the airway (reducing the internal pressure inside it and upstream of the obstruction) and when you add the increasing pleural pressure during exhalation, the equal pressure point (EPP) of the airway moves downstream from the bronchi towards the bronchioli causing the airway to collapse.
The bronchioli don’t have cartilage so they are much more prone to collapse, while the bronchi do have cartilage and have better structural resistance.
By applying pressure in the trachea (or any other upstream part like the mouth or nose) you counter some (not all) of the bronchoconstricion using the same pressure-balance mechanisms and move the EPP upstream towards the bronchi.
And the second method works because the air near the sea has a higher concentration of salt (it’s hypertonic) and when inside your airway it pulls water out from your cells and reduces inflammation. It’s mechanism is similar to a nebulization using a hypertonic saline solution.
And of course, neither is a substitute for medical treatment.