What is a defense mechanism? A defense mechanism is a type of conscious or unconscious technique that is used to protect the ego. The ego is our false self, the “I” that we identify with (read more about the ego). The purpose of the ego is to keep us feeling isolated and separate from others as a survival instinct, and that often happens through various defense mechanisms.