We all are aware of the story of Parikshit Ji, who was the grand son of Arjuna. His virtues are revered till this date. Let us revise it through this link.
When he was spending his last seven days, under the Divine guidance of Sukhdev Ji, he received several instructions, which were compiled later as Bhaagwat Purana. In that scripture, one of the teachings suggests that if we remember Lord, for even a microsecond, we can be freed from sufferings forever. One of the parables from the scripture is based on Gajendra (king of Elephants) and Varah (crocodile). They were not mere beasts, they were aware about their past karmas.
Once upon a time, there lived a king of elephants in a marvelous valley of Trikut hills. The beauty of the valley was mesmerizing. Words could not elaborate the beauty. He was a valorous king, with a large family, and grand army of sturdy elephants. One day, he was trailing across the trails of the valleys. The serene nature, buzzing bees, chirping birds, fragrance from the natural orchards, and the drizzling water falls adorned the senses. Even, the fairies and gandharvas descended from the skies, and the sages spent their times in peaceful meditation. The trumpeting roar of the king used to make carnivores tremble in fear. The herbivores rejoiced in his reign. Lions and tigers were like tiny creatures before the majestic king. He became egoistic out of the immense strengths. He thought that he was the king of the entire cosmos. Pride was rising logarithmically. While he was strolling, he found a beautiful lake, sensing through his trunk, adorned by beautiful blossoms of lotuses. He thought of quenching his thirst, the sun was quite scorching. He filled up his trunk with a grand column of water and quenched his thirst. Out of excitement, he jumped into the water. His fellow elephants were hesitant to take a swim, as the king was supreme in all rites. Soon, out of overwhelming attachment to his family members, he began splashing streams of water from his trunk on his family members. He thought that he was the king of the waters as well. Suddenly, a grand croc appeared in his proximity and clutched his foot. The croc was not a mere carnivore, rather a majestic beast. His size was double to that of the elephant. The elephant gave several strong jerks and crocodile was forced to leave the grip. The croc flipped and appeared on the land. Croc, being an amphibian, was strong enough on the land as well. The war went on for several hours. The family members and his sturdy fellows tried their best, but all in vain. The score on croc’s part was rising steadily. Gajendra was forced into the water, and was taken to deeper depths. The breathes became troublesome for him. He realized that he could not take the scores of breathes then. Suddenly, he was reminded about the Name of Lord. He began chanting, and and asked for help. With immense pain, he flipped his trunk on the surface of water and grabbed a lotus, and visualized that he was offering it at the Divine feet of Lord. Narayan Ji was watching the play, and soon he pulled out the elephant out of he puddle, and the crocodile was freed into liberation, by the Sudarshan chakra. The elephant realized his true attribute, and even the habits which punished him. He was blessed to enjoy the state of jeevanmukti, and his final liberation was assured.