You can politely back out of unwanted conversations by excusing yourself and inviting the other person along, or you can even end it faster with attentive listening. Sometimes the most effective method, however, is to be abrupt and to the point.
Photo by Michael Deming.
Escaping from a conversation while being respectful is a tricky thing. You don't want to be rude, but you also really don't want to waste either party's time. When you've finally reached your limit, Chris Collin, the co-author of What to Talk About: On a Plane, at a Cocktail Party, in a Tiny Elevator with Your Boss's Boss, suggests you should wrap things up with something short and sweet:
Whether you're having a lovely conversation or a crappy one, I think that the way to get out of either is identical. My approach is to look them in the eye with a big smile and say, 'It's been so nice talking with you.' And then you just do a hard pivot and you walk away. As you walk, you are going to be convinced that you have offended the person... But my argument is that we should get over that and know that they will get over it, too. When you treat people like they are grown-ups, and like they're mature, and like they can handle sophisticated things like ending conversations, then they like it, and they like you for it.
The trick is that there's no trick to it. Of course, an approach like this needs to be handled properly. Don't interrupt anyone mid-sentence, and be sure you make eye contact and give a smile when you wrap things up. Also, try to sound as sincere as possible when you mention how nice it was to talk with them. Some folks will find this a little off-putting, but it's your time; value it.
How to Escape a Conversation [Atlas Obscura]