Generally, the word ego is thought of as a person's self-esteem or opinion of themselves, but this is not the actual meaning of the word.
The origin of the word ego is from the Latin, meaning ‘I’.
When we use ‘I’, we are pointing at our self - but we do not know our self because the content and functioning of our mind is mostly beyond our conscious awareness in the unconscious.
This is why we only ever know our ‘sense of self’.
And that is the definition of ego; our ‘sense of self’.
Ego is therefore the aspect of our self we can know - have conscious awareness of - which interacts between the external world and the totality of our self.