Jonah prayed to Yahweh, his God, out of the fish's belly. His prayer is a song of thanks that looks back on his rescue. He called because of his affliction to Yahweh, and Yahweh answered him. Out of the belly of Sheol, the place of the dead, he cried, and God heard his voice. Jonah treats the fish not as a punishment but as the way God saved him from drowning.
Jonah remembers sinking. The flood was all around him, and God's waves and billows passed over him. The waters surrounded him, the weeds wrapped around his head, and he went down to the bottoms of the mountains. He felt banished from God's sight, yet he resolved to look again toward God's holy temple. Then comes the turning point, as Jonah prays, yet you have brought my life up from the pit, Yahweh my God.
When his soul fainted, Jonah remembered Yahweh, and his prayer came in to God's holy temple. He contrasts those who regard vain idols, who forsake their own mercy, with his own promise to sacrifice with the voice of thanksgiving and pay what he vowed. He ends with a short summary of the whole book: salvation belongs to Yahweh. Then Yahweh spoke to the fish, and it put Jonah out on the dry land.