Gas Pain

I am having major constipation and extreme gas pain in my upper abdomen. I’m already taking a prescription to help me sleep and for nausea, I don’t want to add another pill. Any tips? Every time I eat dinner I have diarrhea shortly after, so much that I’m terrified to eat.