The ego is a false sense of self that is attached to fleeting and illusory “objects” (from thoughts, to roles, to changing/superficial forms, and things) in the “external world.”
Specifically, the ego is a distorted self-identity tied to your human-animal nature and social conditioning.
The ego creates a limited sense of “I” focused on obsessive “self-preservation,” and a “sense of other” in relationship to other beings and all of creation in order to sustain a feeling of over-importance and to “stay alive” in the world, failing to see or live the greater Reality that is incorruptible, unlimited, and eternal.
Focused primarily on survival, the ego often compulsively seeks pleasure and avoids pain, and is led by attractions and repulsed by aversions based on unconscious and outdated drives developed from past stored memories/experiences (individually and collectively). The ego exists in a state of clouded perception (and acts accordingly) for the sake of maintaining cohesion and perceived, but impossible, “permanence” in the world.
The ego, however, is nothing but a construct of the body-mind that is used for sense-making in the world/within Maya. Humans create suffering when ignorance causes them to mistaken their personal ego (and limited form/perspective) for the True Self.