Oh, I've been facing the same issue for a long time, and it was really bad for me too. I know how terrible it feels—it's seriously very irritating. The bloating was the worst part, so I consulted a doctor. After many checkups, I found out that I have IBS.
Managing it totally depends on maintaining a healthy lifestyle, and it's essential to follow a healthy diet. Stop eating junk food and switch to a green diet—you'll start to see results. One more thing: when you're dealing with this, nothing will cure it instantly, but the one thing that helps is to completely empty your stomach. After that, you'll feel some relief. I took milk of magnesia at night, and by morning, I had flushed everything out of my stomach.
After that, I started a healthy diet with green salads and milk, and I avoided coffee and tea.