Perhaps the most popular story regarding Ganesha's origin is the one derived from the Shiva Purana. Mother Parvati once wanted to take a bath and created a boy from the dirt of Her own body, asking him to stand as a guard outside while She bathed. In the meantime Lord Shiva returned home to find a stranger at His door, preventing Him from entering. In anger, Shiva cut off the boy's head, upon which Parvati was stricken with great grief. In order to console Her, Shiva sent out His troops (gaNa) to fetch the head of anyone found sleeping with his head pointing to the north. They found an elephant sleeping thus and brought back its head.
Shiva then attached the elephantine head to the body of the boy and revived him. He named the boy Ganapati or commander of His troops, and granted Him a boon that anyone would have to worship Him (Ganesha) before beginning any undertaking.
The Brahma vaivarta Purana narrates a different story regarding the origin of Ganapati. Shiva instructed Parvati, who wanted to have a son, to observe the puNyaka vrata for a year to propitiate Vishnu.
O Beautiful Goddess! Perform the worship of Hari by observing the punyaka vrata for a year. The Lord of Gopikas, the Lord of all creatures, Krishna Himself will be born as your son, as a result of the vrata. On completion of the vrata by Parvati, it was announced that Krishna would incarnate Himself as Her son in every kalpa. Accordingly, Krishna was born as a charming infant, delighting Parvati who celebrated the event with great enthusiasm. All the Gods arrived to have a look at the baby. But Shani, the son of Surya, did not look at him and stared at the ground instead. Upon Parvati's questioning regarding his behaviour, Shani said that his look would harm the baby. Parvati, however, insisted that he should look at the baby. In deference to Her wish Shani cast his eyes on the baby. Due to his malevolent glance, the baby's head was severed and flew to Goloka, the abode of Krishna. Parvati and all the Gods assembled there, including Shiva, were grief-stricken.
Thereupon, Vishnu mounted Garuda and rushed to the banks of the Pushpa-bhadra river and brought back the head of a young elephant. The head of the elephant was joined with the headless body of Parvati's son, reviving him. All the Gods blessed Ganesha and wished Him power and prosperity. Vishnu blessed Ganesha thus:
O Excellent God! O dear one! May Your pUjA be performed before that of any other God. May You be situated in all venerable beings and may You be the best among Yogis. This is My boon to You.
Shiva made Ganesha the leader of his troops (gaNa), and also gave Him the following boon: =All obstacles, whatever they may be, will be rooted out by worshipping Ganesha, even as diseases are cured by the worship of Surya and purity results when Vishnu is worshiped.
The syamantaka jewel
It is said that anyone who looks at the moon on the night of the Ganesh Chaturthi will be falsely charged with theft or a similar crime. If someone inadvertently sees the moon on this night, he/she may remedy the situation by listening to (or reciting) the story of the syamantaka jewel. This story may be found in the Puranas such as the Bhagavata and the Vishnu. Briefly, Satrajit, who secured a jewel syamantaka from Surya, did not part with it even when Krishna the Lord of Dvaraka, asked for it saying it would be safe with Him. Prasena, the brother of Satrajit went out hunting wearing the jewel but was killed by a lion. Jambavan of Ramayana fame killed the lion and gave it to his son to play with. When Prasena did not return, Satrajit falsely accused Krishna of killing Prasena for the sake of the jewel.
Krishna, in order to remove the stain on His reputation, set out in search of the jewel and found it in Jambavan's cave, with his child. Jambavan attacked Krishna thinking Him to be an intruder who had come to take away the jewel. They fought each other for 28 days, when Jambavan, his whole body terribly weakened from the hammering of Krishna's fists, finally recognised Him as Rama.
I now know You. You are the life in all creatures, virility, grit and strength. You are Vishnu, the Primeval Lord, All-prevailing, the Supreme Lord (of the worlds). (Bhagavata 10.56.26) He Who built a bridge (across the ocean) that is a standing monument to His fame, set Lanka ablaze, and with His arrows severed the heads of Rakshasas, which fell to the ground.
As repentance for his having fought Krishna, Jambavan gave Krishna the jewel and also his daughter Jambavati in marriage. Krishna returned to Dvaraka with Jambavati and the jewel, and returned it Satrajit, who in turn repented for his false accusation. He promptly offered to give Krishna the jewel and his daughter Satyabhama in marriage. Krishna accepted Satyabhama as His wife but did not accept the jewel.
In the event one is not even able to listen to or read the story, the following mantra may be recited holding some water in the palm of the right hand. The water is then to be sipped.