I think there can be two approaches, if the offender is someone fairly close.
In the moment, for any of the examples listed, one could quietly say, "Hey, Susan, lighten up. He's doing his best/they're actually doing a great job/that's beyond their control."
The goal here isn't to cause a scene or embarrass the complainer; it's to call their own attention to their behavior. Sometimes people get carried away and don't realize they're behaving badly, and saying something like the above can bring them up short. (E.g., once my mother was complaining privately to me about my SIL. When it started getting harsh, I said, "Wow, Mom, you're sounding very like a mother-in-law." She stopped, said, "You're right. I didn't mean to do that," and refocused on the real issue, whatever it was.)
After the fact, one could have a private conversation with the offender. "Susan, when we were at Le Chic Restaurant, you seemed very unhappy with the wait staff. I felt they were doing a great job. It made me very uncomfortable to hear you snapping at them. Could you tell me what was bothering you?"
I've noticed that sometimes people take their emotion out on strangers when they're actually upset about something completely unrelated to the apparent topic. Maybe Susan is worried about something at work and thinking that she's going to be in trouble, or have to reprimand an employee, and she projects that frustration onto the server/photographer/etc. That doesn't excuse it, of course.
If the offender is not someone close enough to talk to, I think it's best to completely ignore the bad behavior, even pretending the offender doesn't exist in that moment. In the case of a server, etc., I might thank/praise the person extra and increase my own tip to compensate for their having to tolerate the bad member of my party. (We've actually tipped extra-generously because a nearby table of strangers was being absolutely atrocious, to sort of thank the server for keeping his/her cool and maintaining excellent service in spite of boors.)