You need to see a doctor about that. Yellow sputum in a cough is usually a respiratory/bronchial problem caused by a virus or bacteria and the causes can be wide ranging, common cold, asthma, bronchitis, pneumonia, sinus infection etc etc. There are many possibilities. Changing what you eat won't make it go away whereas some broad spectrum antibiotics may do if it is bacterial.