Twice in my life I have 'thrown up' from my lungs.
I told very few people because I doubted they'd believe me, although I have since read that this is possible.
The first time, I was under extreme emotional stress, keeping my troubles to myself, and suffering one of my several bouts of near-pneumomia. I was coughing constantly, and trying not to disturb other's sleep.
As in the second time, I was sitting on the toilet, trying not to cough, when a short convulsion shook my lungs and I coughed, say, 1/4 to 1/2 cup of mucous, onto the floor.
If I remember correctly, I stopped coughing within a day of this first event.
On the second occasion, I was in a semi-tropical country and suffering a very itchy rash, repeatedly, in various locations on my body. Several factors may have caused the rash and the following cough.
Allergy to plants of the Nightshade family...white potatoes, sweet peppers, eggplant, tomatoes, and tobacco, was one.
Allergy to penicillin, which showed up as severe swelling and itch of my hands after the eating of an airline scrambled egg breakfast, was another. I plunged my hands into a bag of ice cubes, and left them there until the ice melted. That worked for the hand symptom.
I had feasted on home-grown cherry tomatoes for the week prior to the flight, and suffered with itches on my feet that required a bucket of ice water to plunge them in.
I am/have been a long-time smoker.
This second occasion was at a time of great financial and social stress, and we slept in a room where a cat had slept. My husband saw rats in the vicinity, and sand flies flew directly into the scratching wounds and bit.
After 'throwing up' from my lungs, we moved to another location, where I continued to cough for a couple of days. It stopped the instant I put my foot on the gangway of the plane to come home!
I don't recommend any of the above for lung cleansing!
However, I've wondered if a natural expectorant might be a very good thing for a person who is either coughing too much, or for someone quitting smoking.
I wonder if that is an expectorant that White Tiger has suggested.
White Tiger is a whiz at herbs.