The problem is constipation. When they are constipated it hurts to poo so they hold it in which makes them more constipated. Constipated kids can even get small amounts of runny poo called overflow soiling whilst constipated. Your first step is to treat the constipation and you will really benefit from medical advice to do this. Then there are some steps to take to help the child learn to relax to poo. But they need to stay on something like Movicol for quite a long time before they get constipated again. It’s fixable.