A stitch — that sharp pain under your ribs — is annoying but harmless. In the moment, slow to a walk, breathe deeply into your belly rather than your chest, and gently press on the spot. It usually eases within a minute or two.
To stop them happening: don't eat a big meal in the hour or two before you run, ease off the pace at the start instead of charging out hard, and focus on slow, full breaths rather than shallow panting. Stitches also tend to fade on their own as you get fitter and your breathing settles into a rhythm, so they bother new runners far more than seasoned ones.