hi, there are a few conditions which cause the symptoms that you describe, namely lactose intolerance, cealiac disease, ulcerative colitis, and crohns disease, even irritable bowl syndrome, hopefully none of the above relate to you, nevertheless you should check yourself for them, try keeping away from
gluten products as well as dairy products for a week
and then see how you feel. thats one simple home test, if nothing changes then seek other more invasive tests, good luck.