Thorn in your side?
It helps not to eat two to three hours before exercise and be well hydrated but don’t drink too much of water before a workout.
As you train, keep your breathing slow and controlled. As you get fitter, the chances of a stitch will become slimmer.
When you are running, inhale on the left foot strike, then exhale on right. I don’t know how true is that but many runners swear by this.