Whenever the earth gets in turmoil, Lord Vishnu incarnates to save mankind and other lives on earth, and his avatars are known as 'Dasavatharam' - the ten avatars!
It is believed that the Lord has incarnated nine times in the previous yugas namely Satya Yuga, Treta Yuga, and Dwapara Yuga. And his last avatar will incarnate at the end of Kali Yuga, the period we are living in now.
Lord Vishnu's first avatar was set in the Satya Yuga, where he incarnated as Matsya Avatar - a half-human and a half-fish avatar with four arms.
There are several versions of this story in Puranas, but the most prominent one was written in Bhagavata Purana.
This is the legend behind Lord Vishnu's Matsya Avatar:
King Satyavrata, also known as Manu, accidentally catches a small fish while washing his hands in the river.
The fish then starts talking to him and pleads to save its life as it will be eaten by the bigger fishes soon. In return, the fish promises to save Manu's life from a great flood that it foresees.
The king then took it back to his palace and place it in a water pot. But the fish grew large and soon didn't fit in the pot. Following that, the king placed it in a huge vessel, a pond, a big lake, and a river, but the fish kept growing larger and he didn't have a choice than placing it in the ocean.
Manu finally realised that it is not an ordinary fish, but the Lord himself.
The fish then asked Manu to build a huge boat to board all medicinal herbs, all the varieties of seeds, animals, and to be accompanied by serpent Vasuki and the seven saints. He instructed Manu to think of him when the flood water increases and assured to help.
During the flood, Lord Vishnu appeared in the form of Matsya, ties the boat to his horn using serpent Vasuki, and tows the boat to the driest point left on earth.
When the flood subsides, it exposes demon Hayagriva who stole the Vedas from Lord Brahma while he was asleep. Lord Vishnu kills the demon, retrieves the Vedas, and returned it back to Lord Brahma.
Life started thriving back on earth once the seeds and animals that were boarded on the boat started procreating once again.
Manu performed a huge Yajna to pacify the gods and a beautiful girl named Ida appeared from the fire. She marries Manu, and they give rise to the human race once again.
Source: TemplePuroHit and Postcard