Once, the demigods, having been cursed by Durvasa Muni, were defeated in battle by the demons. After being deprived of their heavenly kingdom, the demigods turned to Lord Brahma for assistance.
Then, Brahma and the other demigods went to the shore of the ocean of milk and offered prayers to Lord Vishnu. When the Lord was thus offered prayers headed by lord Brahma, He understood the purpose for which they had approached. The supreme lord wanted to enjoy pastimes in churning the ocean. Thus He instructed the demigods to make a truce with the demons and churn the ocean of milk to extract nectar. Thereby the demons would be engaged in labor, but the demigods would gain the actual result, the nectar produced from the ocean
Following the instructions of the Supreme Personality of Godhead, the demigods established peace with the demons. The demigods then approached Bali Maharaj and made a proposal of extracting nectar by churning the ocean of milk. Bali Maharaj accepted the proposal. Then, both the demons and demigods started for the ocean uprooting Mandara Mountain.
The demigods and demons became fatigued as a result of the mountain’s extreme weight, and some of them actually died. Then the Supreme Personality of Godhead, Vishnu, appeared there on Garuda, and by His mercy He brought these demigods and demons back to life. The Lord then lifted the mountain with one of His hands and placed it on the back of Garuda. Then he too got on the back of Garuda and went to the ocean of milk, surrounded by demigods and demons. Then Garuda placed the mountain in the middle of the sea after carrying the Lord to the place of the churning and was asked to leave that place.
Then demigods and the demons brought Vasuki to be used as the rope for the churning rod. The demigods held the large snake’s tail while the demons held the snake close to its mouth. They then started tugging the snake in both directions while exerting a lot of effort. The churning rod, Mandara Mountain, sunk into the sea since it was so heavy and had no support in the water. Then Lord Vishnu appeared in the form of a tortoise, Lord Kurma.
Lord Kurma supported Mandara Mountain on His back. Then the churning resumed with great force. The Lord then appeared on the summit of Mandara Mountain. As a result of the churning, a huge amount of poison called Halahal was produced.
The demigods seeing no one else to save them, approached Lord Shiva and offered him prayers. Then Lord Shiva gathered the devastating poison (Halahal) in his hand and drank it.
Because of the churning, first, a Surabhi cow appeared. The great sages took charge of the Surabhi cow.
Thereafter a white horse named Uccaihshrava appeared and Bali Maharaj took it.
Then Airavata and other elephants appeared and Indra took it.
Then came the gem, Kaustubh, and lord Vishnu decorated his chest with that Kaustubh gem.
Thereafter, a Parijataa flower turned up and was placed on a heavenly planet.
And then the Apsaras appeared from the milk ocean. As the churning continued Goddess Ramaa appeared. She selected Lord Vishnu to be her master.
Next appeared Varuni, a damsel, and demons took possession of this young girl. As the churning continued, Dhanvantari appeared. He was very charming and carried a jug containing nectar. The demons snatched the pot of nectar from Dhanvantari. The demigods again sought shelter from the Supreme Lord. Then Lord Vishnu appeared as Mohini Murti. Lord Vishnu as Mohini Murti enchanted the demons and gave the nectar to the demigods. When the Rahu demon tried to drink the nectar, Mohini-Murti beheaded him. Later, King Indra with the help of Lord Vishnu defeated the demon and regained the heavenly planet
Moral of the story
Whenever a big endeavor is done, the poison comes first and the nectar comes last. Most people get scared of the poison coming out of the endeavor. They think that their endeavor has failed because instead of producing the nectar, the endeavor has produced poison. But we must keep patience because after the poison slowly different kinds of things will be produced by that endeavor, culminating in nectar.
The place, the time, the cause, the purpose, the activity, and the ambition were all the same for both the demigods and the demons but the demigods achieved one result and the demons another. Because the demigods are always under the shelter of the Lord, they could very easily drink the nectar and get its result. The demons, however not having sought the shelter of the Lord were unable to achieve the result
We ought to always seek the advice of spiritually advanced people, just like the demigods. Demigods have a long history of asking the Supreme Lord for assistance, not to mention how often we humans do as well.
Reference: Srimad Bhagavatam Canto 8, Chapter 5 to Chapter 12.