The ego has two parts to it, because the ego is a belief-system based on duality. Duality is based on separation. The ego mind is a 'split mind'. The ego mind is at war with itself and is in conflict. The ego mind pits one part of itself against another part of itself, attempting to make out that the two parts are not whole. It is a device for separation and self destruction.
The ego is therefore two-faced. It supports both sides of all arguments provided they are opposed to each other. It both attempts to protect itself and to hurt itself. It is a victimizer and simultaneously a victim. It exalts itself onto a pedestal of idol worship while at the same time loathing itself with hatred.
The first face of the ego is what psychology would call 'the persona'. This is a fake self-image, made as an attack on who you really are. It's a disguise. It's a veneer of positivity, attempting to focus exclusively on what you like, accept, allow, everything you deem special or valuable, all of your special/love relationships, your favorites, your preferences, and all forms of 'positive judgement'. The persona is the ego's surface facade, like the jewel-encrusted picture frame Jesus describes in ACIM, housing a dark twisted picture of hatred.
You can also see the persona manifesting in the world, for example in the design of many commercial objects, such as a car, whose exterior is made to look attractive and desirable and pleasing, while concealing all of the ugly, dirty, noisy, dangerous, icky 'inner workings' underneath. The persona focuses on a form of 'inclusion', and thus focuses on getting, wanting, desiring, taking, approving, and keeping. But, never to completion... always requiring that certain things are special because other things are not. It is also represented by our point of 'attention' or focus, which homes in on what we want to be aware of, and shuts out everything else.
The second face of the ego is the shadow. You can think of the shadow as the usually indirect implications of what the persona has given value to. So, if the persona is saying, this person is really special to me, as stated in many love songs, then this also means that 'everyone else' is less than special, i.e. in some way 'less than' or despised. So while we special-love some people, doing this automatically means that you special-hate others. That 'hate', seeming to be indirectly and less consciously focused on, goes 'into the shadows'. It gets stored and becomes part of the ego, just as much as the persona is part of the ego. The shadow is the part of the entire ego that has been rejected by the persona part.
So the shadow, albeit seemingly outside your awareness much of the time, becomes this storage place, or a 'room', in which you shove all of the bad, rejected, hated, feared, judged, condemned, unacceptable, wrong stuff that the persona directly or indirectly judges. The shadow houses everything the persona wants to get rid of. The ego persona loves to craft an 'idealistic life' where everything seems to be going smoothly and it includes only the stuff you seem to 'want'. And to achieve that, it has to suppress and repress and deny all of the other signs and symptoms of life sucking or not being what you want. So while you steadily build up a life of pleasantries and people-pleasing and denial and repression, you're secretly accumulating a huge shadow-full of destruction.
At some point that shadow content boils up into awareness, and attacks the persona-self. It attempts to destroy the persona self. So if you're identified with the persona-self, you'll experience it as though you are being attacked. This 'body of pain' (pain body) can come out of seeming unconsciousness and overwhelm the conscious mind, taking over the thoughts and producing total chaos in the person's life. And you will wonder where it came from. And this is also, btw, why 'bad things happen to good people'. Being 'good' is the persona, which generates 'hidden bad', which comes back to bite you in the butt.
So the ego has these two parts and both of them depend on and feed into each other. The shadow's rejection of 'the good' relegates the good stuff to the 'good room' of the persona, and the persona's denial of the bad relegates the bad stuff to a 'bad room' of shadows. It is self-conflict and self-abuse. Good and bad. Right and wrong. You can't believe one without believing the other.
Our challenge then is to stop using both of these. To learn when you are in the persona, which shifts and changes based on who you are with or what's happening and is thoroughly inconsistent. And to recognize when you might've shifted into the shadow-self, suddenly angered into a road-rage or filled with negative thoughts. We need to learn when we are in either the persona or the shadow, and learn not to choose either of these deceitful attitudes. They are both based in right/wrong, good/bad duality. You need to move instead to a point of view of, what is TRUE, and what is FALSE.
The truth shall set you free. Truth means, am I being completely honest and authentic by being in my persona-self, pleasing everyone and not showing anyone how I really feel, or censoring myself? Am I being really honest and authentic when I go into a rage and accuse others and speak hurtful words or attack myself with negativity? Is it TRUE and genuine that I am 'this fake self'? Is it true and genuine that I am an unworthy, hated, fearful victim? Is it true and genuine that I am an inconsistent, unreliable, fickle two-faced liar? We need to learn how to notice when we're in EITHER of the two ego faces, which particular facade we're putting on, and to decide to say NO to both.
When we say not to the persona and the shadow, we are saying yes to God. When we say no to dualistic thinking, we say yes to the mind of God. When we say no to the self-conflict that projects outwardly as parts of the world we like and parts of the world we don't like, we come into acceptance of the totality - what is. When we say no to the separation and split in our own mind, which we see outside of ourselves, we can come to an awareness of wholeness and presence. This is the way out.
But we have to always be careful, to stop feeding and building our shadow-self, an unconscious hidden face of the ego, by trying to be so perfect and ideal in the persona. They are both false. They are both lies. Who are you really? Where is your real personality? What is your genuine self? How will accept ALL of you, and not just a part of you? Each time you choose one thing and reject another, you are choosing one part of yourself and rejecting another. We need to learn to stop doing that. To use denial in a helpful way, to deny the ego entirely - to deny the persona and the shadow the ability to run our lives. To choose to be in the Holy Spirit.
Getting rid of our shadow stuff, all the stuff which our persona self thinks is the 'stuff that is wrong with us', that we 'need to get rid of', in order to 'become more spiritual', is a trap of the persona. It would have you get rid of all of the shadow, by shoving it into the shadow more, so that it is more unconscious, so that you can pretend to only be aware of the 'good stuff'. And then your focus on the good stuff will actually create even more bad stuff, because you can't sit on one end of the see-saw without the other end being affected.
The only way out is truth, honesty, awareness, responsibility, acceptance, wholeness, and the various other properties of a WHOLE mind, i.e. the right-mind, which becomes the one mind, united with God.