Below is a story from Yoga Vasistha’s Sthithi(Existence) Prakarna. This story illustrates how ego (Ahankara) can be tackled by knwoledge (Jnana)(knowledge mentioned here is not be confused with bookish knowledge of maths or science, the knowledge mentioned here refers to the spiritual knowledge). It is suggested to read the story of Dama, Vyala and Kata before reading this story:
Summary: Having given out in the previous story that the three Asuras were defeated through Ahankara, the author gives out this story to show that success will result in the case of non-Ahankara.
After the utter annihilation of the previously mentioned Asuras, Dama and others, Sambarasura who was well versed in Maya vidya became greatly incensed with the haughty Devas and having reflected in diverse ways upon devising means for their destruction soliloquised thus “The three Asuras, Dama and others, whom I created before were devoid of Atma-Jnana; and hence seized with the unreal conception of I and mine, succumbed to the Devas in fight. Therefore I will again create, through my Mayavic power, Asuras of Jnana, well read in Atma-Jnana Sastras. Possessed of the true Jnana, they will not be destroyed through the illusory Ahankara.”
With this determination to overpower the Devas, Sambara willed into existence, through his stainless mind, three Asuras who arose through Maya like bubbles on the surface of the ocean encircling the earth. They were omniscient and through their own wisdom, knew themselves to be of the nature of Jnana. They had not the taint of Sanchita Karmas or love or hatred. They were able to firmly be in whatever state they wished to be. They were so illuminated as not to have any doubts. These pure personages cared not a straw for the whole Universe; their names being Bheema, Bhasa and Drudha. Being asked by their maker to wage war with the Devas, they marched straight against them and fought terribly with them for countless years: whenever the idea of I and mine flitted across the minds of these Asuras, they would probe unto their hearts for the origin of I through their subtle Jnana enquiry. And then this manifestation of I and mine vanished at once like the wealth of non-charitably disposed persons. Those who have divested themselves of this everwaxing Ahankara through Atmic enquiry in diverse ways will never be touched by the fear of births and deaths, will be stainless and content with whatever objects they can easily get and will look equally upon all through their present Jnana vision existing from a remote period.
Therefore in the war with Bheema and others, the whole host of Devas chose rather to fly away from the field like the wealth dissipated by a rake in a short time and to hide themselves in different quarters. They then went to Vishnu for asylum and prostrated themselves before Him who strode the earth with three strides. Having assured them of his aid and told them not to be afraid, Vishnu marched to the battlefield in great anger and waged a rare war by flinging at the three Asuras the weapon, discus. The three Asuras were burnt by the flames issuing out of the said weapon and were carried at once to the Loka called Vaikuntha wherein resides Vishnu wearing on his neck the Tulasi garland. Thus through Vasanas, bondage is caused; with the disappearance of the former, the latter also vanishes. Therefore, Oh Rama, you should know well all things through your discriminative Jnana. Through such a knowledge of Tatwas, there will be an extinction of all Vasanas which form the medium of enjoyments. With the extinction of all Vasanas, the undaunted mind will get quiescence like an oilless lamp.
P.S.: The above story is from the english translation of Yoga Vasistha by Shri K. Narayanaswamy Aiyer. This book is available for free at http://www.estudantedavedanta.net/laghu-yoga-vasishta-english-translation.pdf. This translation was published more than hundred years ago i.e. in the year 1896. If anybody still holds the copyright for this translation, kindly contact us with appropriate identification proof and copyright proof, upon verification we would remove this story from our website if required.