Most cases of very thick and yellow sputum are caused by bacterial infections, more commonly bronchitis and pneumonia. It may also be caused by abscesses in the lungs, and there are cases of bronchiectasis and bronchial asthma with bacterial infections. It is usually necessary to treat with effective antibacterial drugs, the more commonly used drugs are cephalosporins, penicillins, and also macrolides. It is also necessary to use drugs to clear heat and remove fire and cough to relieve phlegm, which can be treated with Shuang Huang Lian, or Qing Kai Ling Oral Liquid, or Snake Bile and Chuan Bei Liquid, and Aminobisol. You should also pay attention to drinking more water, pay attention to diet, not to eat stimulating food. You can eat more nutritious and fresh vegetables and fruits.