We use four defense mechanism to keep our perceptions of the world consistent: stimulation, organization, interpretation & evaluation and memory.
1. Denial is when people are overwhelmed by the anxiety present within a situation, they can engage an even more severe form of memory repression. For example at school, a student seeing a grade of "C" next to their name, and automatically assuming the professor made a grading error.
2. In projection, anxiety is reduced by claiming another person actually has the unpleasant thoughts that you are thinking. You are attributing your own thoughts to someone else.