The ego is the only part of the conscious personality. It's what the person is aware of when they think about themselves, and is what they usually try to project toward others.
The ego develops to mediate between the unrealistic id and the external real world. It is the decision-making component of personality. Ideally, the ego works by reason, whereas the id is chaotic and unreasonable.
The ego operates according to the reality principle, working out realistic ways of satisfying the id’s demands, often compromising or postponing satisfaction to avoid negative consequences of society. The ego considers social realities and norms, etiquette and rules in deciding how to behave.