Jonah prayed his prayer at a time when he had hit rock-bottom. Life couldn’t get any more difficult or awful for Jonah at the point where he spent 72 hours in the belly of a big fish. Jonah’s prayer is one of repentance. He repents of his idolatry and experiences the mercy of God to go and do what God had originally led him to do.