The symptoms as mentioned in your post can be due to:
1. Irritable bowel syndrome
2. Any infection in the Gastrointestinal tract
3. Irregular dietary habits
Symptomatic management involves maintaining optimum hydration status and electrolyte balance & having a plain, soft diet
But, it will be better to consult your Physician and get a proper clinical examination done.
If any infective cause is suspected, then subsequent management should be done by administration of antibiotics.
Investigation like Stool examination, Ultrasound
scan of abdomen & colonoscopy
will be helpful.
Wishing you a Good Health.