How can I treat a cough with phlegm?

You can buy your own cough medicine or syrup from the market, most of which are over-the-counter and routinely available in pharmacies.
However, if the patient has predominantly yellow sputum and a large amount of sputum, or needs to take antibiotics, they need to be taken under the guidance of a medical professional and should not be taken on their own, leading to antibiotic abuse.