We are going to summarise the avatara called Vakratunda of Lord Ganesha, which he took to eliminate Matsarasura.
Did he eliminate Matsarasura then?
No.
He reformed Matsarasura. That was sufficient. Matsarasura became a servant of Lord Ganesha. He was harmful to everyone. After reformation, he became good for good people and bad only for evil people.
Matsarasura was Indra's son, born out of his lust. Then he did tapas of Lord Shiva and got a boon from him that he would become the emperor of the universe. He started conquering all the worlds one by one.
Finally, he conquered Swarga, Vaikuntha, Satya Loka, and even Kailasa. All the Devas and Trimurtis were evicted from their own worlds. They were all taken into captivity.
At one point in time, he released all of them and told them to stay within Kailasa, not to come out. He proclaimed himself to be the sole and whole lord of all the worlds.
He banned pujas, yajnas, demolished temples, and told everyone to worship him instead. His atrocities increased day by day.
One day, Lord Dattatreya came to Kailasa. After seeing the plight of the Devas, he told them to pray to Lord Ganesha.
They all started doing tapas with his Ekakshara Mantra, which is 'Gam'.
Pleased with their tapas, Lord Ganesha appeared before them, seated on a lion, and promised to help them. This was his Vakratundavatara.
Lord Vakratunda, along with the Devas and Munis, went to Matsarasura's capital and challenged him.
In the fierce battle that ensued, Matsarasura's two sons were killed. Then, while facing the lord in battle, Matsarasura was transformed after he saw the real nature of Lord Ganesha.
Lord Ganesha is, in fact, Parabrahma, Paramatma.
This Matsarasura realised and surrendered before the lord.
The Devas and Rishis chanted a stotra in praise of Lord Vakratunda.
This stotra has 21 verses. If you chant this stotra 21 times a day for 21 days, whatever you wish for will come true.
Here is the stotra:
Pg 123
Lord Ganesha was pleased with this stotra. He asked them to ask for any boon.
They said they wanted permanent bhakti at his feet.
Because they knew this secret:
If you have bhakti at Lord Ganesha's feet—steady bhakti—then you do not have to ask for anything.
Everything that you deserve will come to you. Nobody will be able to stop that.
After granting them that wish, Lord Ganesha disappeared into his own abode, the Swananda Bhuvanam.
Just like Vaikuntha and Kailasa, Lord Ganesha's own world is called Swananda Bhuvanam.
Astrology
Atharva Sheersha
Bhagavad Gita
Bhagavatam
Bharat Matha
Devi
Devi Mahatmyam
Ganapathy
Glory of Venkatesha
Hanuman
Kathopanishad
Mahabharatam
Mantra Shastra
Mystique
Practical Wisdom
Purana Stories
Radhe Radhe
Ramayana
Rare Topics
Rituals
Rudram Explained
Sages and Saints
Shiva
Spiritual books
Sri Suktam
Story of Sri Yantra
Temples
Vedas
Vishnu Sahasranama
Yoga Vasishta