The ego (Latin "I", German: Ich) acts according to the reality principle; i.e. it seeks to please the id's drive in realistic ways that will benefit in the long term rather than bring grief. At the same time, Freud concedes that as the ego "attempts to mediate between id and reality, it is often obliged to cloak the Ucs. [Unconscious] commands of the id with its own Pcs. [ Preconscious ] rationalizations, to conceal the id's conflicts with reality, to profess ... to be taking notice of reality even when the id has remained rigid and unyielding." The reality principle that operates the ego is a regulating mechanism that enables the individual to delay gratifying immediate needs and function effectively in the real world. An example would be to resist the urge to grab other people's belongings, but instead to purchase those items.

The ego is the organized part of the personality structure that includes defensive, perceptual, intellectual-cognitive, and executive functions. Conscious awareness resides in the ego, although not all of the operations of the ego are conscious. Originally, Freud used the word ego to mean a sense of self, but later revised it to mean a set of psychic functions such as judgment, tolerance, reality testing, control, planning, defense, synthesis of information, intellectual functioning, and memory. The ego separates out what is real. It helps us to organize our thoughts and make sense of them and the world around us.

More Info: en.m.wikipedia.org