How did Lord Krishna teach Balarama [his own brother] to get rid of his Ego? What was the plan he made that Balarama turned good after that incident?
Lord Balarama is Lord Vishnu just like Lord Krishna is Lord Vishnu also. They both are the Supreme Lord who appeared in two forms as two brothers, Krishna and Balarama.
And what they did is something called "pastimes of the Lord", ie lila. And we should understand that when the Lord performs his pastimes or lilas, He is just like a player or like an actor playing in a theatrical drama. There are verses in the scriptures that say about the Lord like that, such as Bhagavatam 1.8.19, and such as this one from the Bhagavatam 1.3.37:
"The foolish with a poor fund of knowledge cannot know the transcendental nature of the forms, names and activities of the Lord, who is playing like an actor in a drama. Nor can they express such things, neither in their speculations nor in their words."
So when the Lord behaves to appear like he has an ego, or something else that looks like he is an ordinary human, we should understand that this is just to appear to be as such, just like when an actor is playing in a theatrical drama. Even in such circumstances the Lord is situated in his transcendental position that is above ordinary mundane affairs. And in reality He is not influenced by the ego, deluded mind, improper behavior, etc.
The same point as with the Lord who is playing like an actor in a theatrical drama we can see in the application of the word lila (līlayā) as referring to the pastimes of the Lord which he performs in his various incarnations (avataras) is explicitly mentioned in the Bhagavatam 1.1.17:
tasya karmāṇy udārāṇi
brūhi naḥ śraddadhānānāṁ
līlayā dadhataḥ kalāḥ
tasya — His; karmāṇi — transcendental acts; udārāṇi — magnanimous; parigītāni — broadcast; sūribhiḥ — by the great souls; brūhi — please speak; naḥ — unto us; śraddadhānānām — ready to receive with respect; līlayā — pastimes; dadhataḥ — advented; kalāḥ — incarnations.
"His transcendental acts are magnificent and gracious, and great learned sages like Nārada sing of them (parigītāni). Please, therefore, speak to us, who are eager to hear, about the adventures (or pastimes, ie līlayā) He performs in His various incarnations."
The word līlā is explained in the Monier Williams Sanskrit-English Dictionary:
play , sport , diversion , amusement , pastime , mere sport or play
Thus, pastime or a lila is an activity that someone does regularly for his enjoyment or amusement, for his fun. Just like an actor who is playing in a theatrical drama for amusement, the same point is seen in the application of the word līlā (līlayā).
It would be wrong to assume that an actor who is playing on the stage in a theater for amusement is some poor or miserable soul under the negative influences that he has to play.
Lord Balarama is certainly not an ordinary living being, ie a jiva soul (jivatma), but is the Supreme Lord or Supreme Soul (paramatma), and thus He is that what Upanishads call Brahman or the Absolute. Thus we should understand his position according to the teaching of Vedanta as an entity which is not under the influence of ignorance, improper behavior, deluded mind and other negative influences such as sins, injustice, etc. And if some story describes him as if he was under such negative influences we should understand that to be just a lila (pastime) of the Lord.
People who do not understand that are lacking in proper understanding of the philosophy of Vedanta. They are advised to learn Vedanta first, to be able to properly understand those things, and then they will be not confused to understand properly the position of Lord Vishnu, or in this particular case Lord Balarama. We can see that those people who do not know Vedanta properly are often confused and misunderstand stories that are told in the Puranas and Itihasas. My favorite system of Vedanta is that one of the Gaudiya Vaishnavas.
Balarama thought within himself that nobody can win him. Krishna sent Balarama to invite Hanuman. When Balarama said I am Balarama here krishna sent me to invite you. Hanuman asked tell once more who are you--Balarama said Iam balarama. Hanuman slapped on his face and told are you powerful than my Rama? Bala is strength in Tamil. In a fury Balarama went and told Krishna and came with many soldiers. All the soldiers were killed by Hanuman. Again Balarama went to krishna and told the incidents. Krishna at pne saod hope by this time your ego was get rid off--hanuman is mightier then you. Source Kodayin paadhai by Mukkur Lakshmi Narasimhachar
Balarama is a Jivatma but he did not live in samsara world. In Sri Sampradaya, he is a nitya Suri along with Garuda, Vishvaksena "the commander in Chief of Lord's Army".Also there are 500 fairies in Vaikuntha to decorate new jivamas who attain moksha with royal attire. Balarama or Sesa is Vishnu Tattva.