My favorite phrase.... "if that's the worst thing that happens to me all day, I'm having a damned good day".... or, "if that's the dumbest thing I do all day, etc...."
That's been my go-to "ah fuck" reaction for years, and I call on it a dozen times a day. Can probably count on one hand the number of times it hasn't gotten me through the moment with a placid smile on my face.