For me it helps to consider how many people have had it worse. It's cynical, I know, but knowing that diarrhea killed more people than guns in the USA civil war is comforting. The Union soldier who died squatting over a pit while cannons boom and flies descend makes me remember how comfortable my climate-controlled bathroom is.
Another thing I've learned is to not feel guilty when I've abandoned whatever I was up to before the pain started. I'm lucky to have a partner who is very forgiving when we are traveling or doing leisure activities and I have to rush to the nearest bathroom. It's not your fault that you're not doing what you were supposed to be doing. Don't hesitate to curse your maladies for interrupting your life. It feels good to stick it to the man, even when the man is your own digestive system.