I second everything written here.Besides being scary, flipping is deadly dangerous. You have to solve the problem of Why this is happening ASAP.
A tortoise's lungs are at the top of the body - when they flip over, the lungs are then crushed by all the other organs and the tort suffocates, overheats, experiences cardiac stress, and can die. The kidneys secrete lots of stress hormones, and the animal may forcibly urinate and defecate. Torts that flip under heat fixtures do not survive for long.
In order to counteract the stress and dehydration, give a warm soak. Stay and observe so that the animal does not drown if they are too exhausted to hold up their head after drinking.
Post photos of your set up to get feedback about this serious problem.
They don't need to be comforted. They just need to be flipped back over, and you need to figure out why its happening and how to prevent it.My tort has flipped over several times. (he's a red foot) and I want to know how I can comfort him after he's flipped over.