Hazrat Younis (AS) who was the messenger of Allah and was very pious man; tried his best to invite people of Nineveh to the monotheism and to worship only the God. He always used to try to ask people to get away from idolatry and polytheism, but they didn’t listen to him. People of Nineveh ignored Hazrat Younis (AS) and his knowledge, and they had become very proud on their own, and they made Hazrat Younis (AS) tired and disappointed.
When Hazrat Younis (AS) became disappointed from the people of Nineveh, He cursed on them and asked God to send his torment on them. After his cursing he moved away from the people of Nineveh. When the people felt that they are going to be punished, they repented and asked God to forgive them. Hazrat Younis (AS) came back to the people of Nineveh and saw that they are forgiven by God. Hazrat Younis (AS) lef the people again and went to the sea, due to the high and big waves got into the stomach of a fish. God has talked about the reason of his salvation in Holy book of Quran, Says:
[1]“فَلَوْلَا أَنَّهُ كَانَ مِنَ الْمُسَبِّحِينَ ﴿١٤٣﴾ لَلَبِثَ فِي بَطْنِهِ إِلَىٰ يَوْمِ يُبْعَثُونَ ﴿١٤٤﴾”
And had he not been of those who exalt Allah, (143) He would have remained inside its belly until the Day they are resurrected. (144)
There is a quotation from great interpreter Mr. Qattadeh in Majmaol Al-Bayan where he says: Tasbeeh of Hazrat Younis in the verse mean prayer.[2]
source : Aspect of Prayer By Husayn Ansarian