What do you do?
Do you join them in the depth of emotional waters that they are having a hard time navigating?
Simplest thing to do is "do not engage". I know it can be tempting to not look weak in front of the other/s or be runned over or whatever else the ego tries to make it out to be. But that is truly where the reaction, not response will be coming from.
Instead, I offer, for you to go higher. Go into your heart, pull out as much compassion as you can muster and respond from there. The response may look like silence. It may look like acknowledgement of the person's frustrations like "this seems to be giving you a hard time" or "blah, blah must be really frustrating to you, how can I help." It may be you saying excuse me and walking away. It can be you listening attentively and holding the space for them to release.
Whatever you choose, just don't swim in the emotional waters with them. Help bring them to shore and know that they are hurt being who hasn't finished working on themselves. Hurt being hurt, they are not inherently bad, just in need of compassion and love. Also know your limits and show compassion and love to yourself also!