How do you treat the cough from ice cream?

Ice cream has been favoured very much by ray peat. In my childhood, for 2 years I had ice cream regularly at the end of it, I had a severe cough problem and I had to take a gas to clear the mucus that was coughed in my throat for a week. How do you prevent this from happening? Due to that incident I have reduced my consumption of ice cream over the years. I have stayed away from it and felt like I learnt my lesson.