The ego is a tricky one... Let's say you want to answer someone in an argument to "win" it... but then you control yourself and move on, effectively winning a small battle against your ego.. but then your ego will go like "aha, see how great I am, I won against the ego!"
The analogy I usually think about is that the ego is like your finger nails.. they have their purpose, can be useful, but you gotta trim them down regularly otherwise it grows uncontrolled and can hurt yourself and others, plus it becomes fragile.
How to trim it though? I think there were some good suggestions already.. observation, self criticism, being in a relationship, having honest friends, psychedelics, cultivating empathy, etc etc.
For me, also martial arts that have true sparring constantly humble me because there is no way to pretend you are at a different level, you will get your ass handed to you daily and its an undeniable visceral experience.
Good luck with your path , and let us know if you find good strategies or tools to deal with the ego