It's a necessary 'mechanism'. We have an ego for a reason. But in most instances in modern humans it gets triggered unnecessarily, and then just becomes a nuisance. So we need to learn how to ignore it when it gets triggered unnecessarily. And that means learning how to recognize those rare occasions when it serves it's purpose, and then how to dismiss it on the many other occasions when it doesn't. So it's not really a matter of "fighting" it. It's just a matter of learning to ignoring it when it serves no useful purpose.
The native Americans used to see strong emotional reactions as spirits passing through their bodies, momentarily. When they would feel a pique of rage, or fear, or resentment, or whatever, they thought a 'spirit of rage", or of fear or of whatever had momentarily inhabited the same space as themselves. That these spirits were not of them, but just were just passing through them. So that if they would just wait a few seconds, or perhaps a minute, that spirit would move on out of their space, and be gone.
I always thought that was a nice way of perceiving those negative and unhepful piques of emotion. Just stand still for a moment, and let them pass through you.
However, sometimes they would get "stuck" inside a person, and then the "medicine man" would need to come and chase the bad spirits out of them. A primitive perspective, but psychologically effective.