Probably the best place to start is: cultivate some compassion for the person (whether you think they 'deserve' it or not!) and yourself. Ahimsa, the principle of non-harming, is always a good position. Yes, it can be hard to cultivate compassion for people who are pushing your buttons. But if you think about it, the best scenario is for your nemesis to be happy and well. If s/he were truly happy and well, s/he wouldn't be bothering you, right? So - how do we do that, anyway?
Observe and let go of your judgments. If this is hard, it can help to remember that people become the way they are for reasons that are multifaceted, and often out of their control. For example, a child doesn't ask to be horribly abused or neglected, and if s/he grows up to be an angry, cranky person it's probably understandable. If there's anything that I learned from my time working at the state hospital, it's that horrific, tragic things can happen to innocent people. Some people's stories are so sad it's a wonder they have any semblance of sanity. So if a person seems difficult, there may be a reason. Just remember: the person you are dealing with has a backstory, and you probably don't know the half of it.
Similarly, it can help to consider that a person's outward demeanor (ex: intimidating, confrontational, needy) may serve a purpose or meet a need. A person who is arrogant and aggressive may build a life around promoting/protecting herself because she feels she needs to. The outward behavior may be defending against feelings of inadequacy and fear.
Consider also - can you connect with this person at any level? You may be surprised to learn you both love poodles or Thai food. Or both. Or something. Look for other aspects of the person besides their "difficultness."
With all this in mind, you can soften your self-protective stance and relax when approaching someone and remind yourself, "we are on the same side." If you put your armor down, they are more likely to do the same. Take a breath, or several.
Next, ask yourself: what's the best thing to do - for all involved? Consider the viewpoint of the greater good, not just what serves your ego. Contemplate your actions from a place of love (corny as that may sound) rather than fear and self-protection. And remember that behaviors - including micro-behaviors like talking and thinking - have consequences, so try to do the right thing even when it's difficult (remember - tapas!). Best to leave a situation with a difficult person with a clean conscience. Less to worry about later.
If you have a person whose life and conduct you admire, you might bring them to mind and ask: "what would [the Buddha/Jesus/Gandhi] do? Yes, it's become a cliche, but it can be helpful in a pinch to give you clarity and a reminder of something higher than, say, revenge.
Avoid control struggles whenever possible. Ask yourself: am I really just trying to control this situation? For the good of everyone involved, do I need to? I'm not saying that you should let someone walk all over you. But if someone seems to need to have control of something and the only issue you really have is one of control (as opposed to how they want to handle it), maybe you can let it go. You can always choose how you respond to something for yourself - it's not like you're handing over the keys to your life. Besides, a person isn't really taking control if you give it to them mindfully. Of course, there will be times you will need to take control of situations for the good of everyone involved, but this is best done mindfully, compassionately and NOT in the service of your ego.
Finally, after you've interacted with a difficult person, instead of mentally concocting some story line about how awful they are or patting yourself on the back for surviving it, contemplate wishing them well. Realize, again - that this person suffers just like the rest of us, and doesn't want to any more than you do. Cultivate the wish for the person to be free from suffering. If this sounds difficult, it can be. Buddhists use this premise as form of meditation: consider the idea that every person you meet was your mother in a previous incarnation in order to cultivate the wish for them not to suffer. Wow.
So maybe you're thinking - why should I have all this love and compassion for this person who is driving me crazy?! Try it and see if it doesn't feel better than collecting resentments. I believe it's also called love thy enemy.