It seems to be difficult at times dealing with people. People can Pull your strings and push all your buttons to make you react an contribute to their state of anger or gossip or ignorance.
Through my studies of Buddhism. I found meditation is a must, Learning to center yourself an to improve your focus. The Eightfold Path is like the corner stone of my Behavioral guide line, along with the 5 Precepts.
When you realize in the moment ( 07. Mindfulness ) , that they are either : angry, are ignorant of their own actions, or prefer to gossip an cause people to divide from each other. You will know where they are coming from, an their goal. Some of the things you may do is you can just walk by them an ignore them, or help to correct them. As with correcting them you will meet a very negative response. Not many people accept being corrected, mostly because of Ego. But if they are willing to see the truth then you have just helped one person more often then not out of their own ignorance of their actions.
I learned that in the Non self it is Like the removal of Ego an returning to the true self. Who you were before the life experiences an the world around you forced you to develop this "ego". Basically if you have no ego nothing can bother you in a way. When we are clashing with people its because of Ego, when people say "take yourself out of the situation" seems to me its hints at Buddhas teachings of NON Self. Take the Ego out of the batch an you can see clearly an respond clearly. If they say things to hurt you an you are unaffected by them, they lose that power to harm you. When they cannot control you, they cannot become difficult to you, because when you are in control, you allow what happens in your life to a degree.
If they are difficult because of religion then you should ignore them, a religious person who wants you to become like them only are focused on their own desires an not the desires of you. They may be intolerant of your beliefs, but that only means you should be tolerant of theirs, an them, as a Buddhist seek the middle ground, religions come an go an some have stayed for a little while, keep true to your own understanding. Dont be convinced by others. You must be able to convince yourself an if you are not convinced then dont follow it. Fundamentalist have their own way of doing things even if its not true to their own dogmas or doctrines they cannot be persuaded, more often then not, they are conditioned to that method an will remain in that method till they are willing to leave it. There is nothing you can do but only be kind to them an if they are curious answer questions. From my experience Fundamentalist are aggressive an will come at you over an over an try to guilt you into following their way an will shun you or condemn you according to you response. It will save you time an effort to be kind an compassionate but firm in your own convictions.
Through Meditation you build mental awareness, an a stronger fortitude of mind. Concentration is key, when you are in control, you will have the ability to respond out of thought not reaction for them. When you are in the present you can say or do things vastly easier. Couple of the Eightfold Paths to remember:
Right Speech - Be careful of what you say- does it become aggressive to others? Does it divide others? Is it at the right time to be said? Will they mature from what you have said?
Right Action - what are the right steps to the situation? If by becoming involved will they learn anything or will it further cause you suffering an trouble. Is it best not to become involved? Can you become the diplomat an help the situation mold into common understanding. It could simply be a misunderstanding that escalated into something worse.
Right Mindfulness - In the moment are you present? Do you see what they are getting at? What is the cause of their reactions? What causes them to respond an become so difficult? Can you find the Middle Path that will lead to each persons peace?
Right Concentration - Through meditation, you create a stronger awareness of self, an centering your self well help keep you from being caught off guard an unable to respond. Becoming intimidated by the situation.
The Dhamapada states : In this world where has Hate conquered Hate? Only Love can conquer Hate. This speaks to me in the way of dealing with people, have compassion an love for them, some times people are simply difficult because others are difficult to them all the time an they only developed a habit of being difficult.
key points : Try to see where the person is coming from
What actions can do you to diffuse the situation, or if you should act at all.
Remain Calm an Dont give into Intimidation, Be mindful of the moment.
Are they just in need of some one to understand them?
If they are wanting to cause trouble, then dont contribute to the trouble.
Hopefully this helps you in some way or another.