Then, you need to eat more of things that have more dietary fibers.
And then, it takes some time. I would try to make a sugar free diet and reduce sugar and fruit sugar wherever is possible - also it's replacements, artificial sugars. Better drink water with just a drop of Sirup or water mixed fruit juice instead of a coke/sprite/gatorade... Better not that pastries.. prefer less sugar.
Sugar is actually "bad" for our guts bacteria composition. Reduce it for half a year and see the effects.
And then, you may start to train your gut by just sitting on the toilet - but, put a small footstool beneath your feet. That simulates the most natural way of sitting down for a shit in the wild. Relax.
One is set sure every day: Shit happens.