The ego is the component of personality that is responsible for dealing with reality. According to Freud, the ego develops from the id and ensures that the impulses of the id can be expressed in a manner acceptable in the real world. The ego functions in both the conscious, preconscious, and unconscious mind. The ego operates based on the reality principle, which strives to satisfy the id's desires in realistic and socially appropriate ways.