It's really important to be selfless in a relationship. When one succeeds in something and you don't feel happy about it and berate the other person instead, it is ego that makes you do it. Though ego is a three alphabet word that seems harmless, it can make or break any relationship. However, it could do much damage for people who flaunt it.
More often than not, our egos are feelings that come naturally to us and we cannot actually overcome or fight against it. It can be won over only by accepting it and controlling ourselves while not giving in to its demands.
It's unhealthy and one shouldn't be attached to it. How can you identify if you are egoistic or not? Well, it's quite simple. When you start believing that "this is me and I am the only truth of my life," you should know that something is wrong. The belief shows how self-centered you are and not quite attached or at the least bothered about people around you.
There is a fine line between ego and self-esteem where one should know where they stand. Feeling pride in oneself is a good thing which lets you, as an individual, be confident in a crowd. But ego is trying to overpowering the other person with your pride or superiority.
Ego comes to surface in a person as he/she gets a new ability. And there is nothing wrong with it as long as you are well aware about it.
I guess it's a persistent dance of cognizance and effort which will help to keep it in check.