Summarize this article:

Figure out with your friend beforehand a distress signal that you each can use to get out of a boring or uncomfortable situation. It could be a word or a gesture. Here are some suggestions: Tugging your earlobe A word you wouldn't use otherwise in conversation Winking If your friend seems like they're having fun, let them know that you're going to leave. If they give you a stressed look or your sign of distress, don't go. But, if they tell you they're having a good time and seem as though they would be okay without you, then leave the conversation. You can chat up other people in the group, use the restroom, or go find someone else to talk to. Don't ditch your friend with this new person. Gauge the situation to see if they want to be left alone, or if your friend wants you to come back to rescue them. You can shoot them a quick text, or make eye contact with them from across the room. Either way, don't abandon your friend for the night without checking in with them first.

Summary:
Have a distress signal. Leave the conversation. Determine if you should return.