You're the only person you can control
I'm not an oracle, and it's usually easier to solve other people's problems than my own… or at least seem to. Even still, when others ask me for advice, I try to help them consider what they could do to improve the situation. I take this approach even when the advisee is the recipient of someone else's bad behavior. If someone is being mistreated by their boss, for example, I might suggest that they quit, talk to HR, or ask for an internal transfer.
Sometimes, the pushback doesn't take very long. “They're the jerk. Why don't you tell them to be different!?”
Of course, the other person often is the jerk, and I will try to tell that person to be better, if I can. At the same time, bad people—the truly awful, cruel, uncaring people of the world, the people others complain about—they usually don't take advice. They don't care what I have to say. If they were so reasonable, they probably wouldn't be causing this problem in the first place.
To that point, I try to remind the listener, “you're the only person you can control.”
It's not fair, but remembering that may be the only strategy that has any chance of succeeding. Jerks are everywhere, and if our happiness depends on them being better, we're probably not going to be very happy.
None of this is to excuse the importance of listening to others and trying to understand their pain without trying to fix anything. I could always do a better job of that.
If you do want something to change, though, focus on what you can do differently. It's not fair, but it may be the only potential solution worth paying any attention to, because you're the only person you can control.