Say person A and person B are having a discussion/argument.
Person A tells person B that his views are arrogant, or closed-minded, or some other derogatory adjective.
But in fact it is person A's views that are arrogant, closed-minded, etc. Person B's views are usually the exact opposite of what person A is accusing him of.
This sort of situation happens a lot when discussing politics or religion, for example.
What do you call person A, for calling person B something that he himself is?
I guess, for the most part, person A doesn't actually realize that he is the one that the adjective applies to, and not person B. Maybe there is a different name if person A knows the adjective also applies to him.
An idiom for this situation is the pot calling the kettle 'black'.
A fitting term for a person who does this is hypocrite; though the exact meaning of that word is someone who pretends to be what he is not, it applies because the person is pretending to be better than whom he is denouncing, while in reality he is the same.
Psychological projection or projection bias is a psychological defense mechanism where a person subconsciously denies his or her own attributes, thoughts, and emotions, which are then ascribed to the outside world, usually to other people.