Chapter 2 is a prayer by Jonah to God from inside the fish.
2:1-3 Jonah praises God for delivering him from the sea and providing the fish which saved him. He recognizes that God heard his prayer and his cry for help and God answered by providing the fish to save him. Jonah also realizes that the sailors on the boat were actually carrying out the judgment of God.
2:4-6 Jonah tells God that he has been banished from the sight of God but he will look again toward the temple of God as a new renewed hope. Jonah was sinking down, but God brought him up.
2:7-10 Jonah remembered God and he prayed to Him. Jonah proclaims that salvation does come from God, that he will sacrifice to Him, and that He has shown Jonah grace that others forfeit. Jonah returned to dry land out of the fish.