When dealing with a difficult person, the first thing you can do is try to understand the person's goals and what really causes them to behave in such a way. This gives you perspective and detachment so that you can either become more assertive or more empathetic.
Some people are simply not aware that they are difficult to interact with; most of the time, it is beneficial to explain to them openly that they are unreasonable.
It is important to notice when people do not respond to reason. In this case, try to keep the focus on them, and do not make yourself the target of irrational comments. It is also inadvisable to insist on them understanding a logical point of view. Do your best to avoid the subjects that set them off, and avoid spending more time with them than is necessary.