It was not actually God, but the sailors, who threw Jonah into the sea. But Jonah recognized that it was what God had intended, in order to bring Jonah back to where he ought to be. In the city of Nineveh being a humble obedient servant of the Lord.
The prayer from inside the fish started with recognition that God had already saved Jonah from the sea. He talked of the prayer already answered. So we can suppose that was a prayer prayed quickly as he was thrown overboard or was desperately trying to swim in the raging waves.
This part of the story, (the three days and three nights) is much harder to believe than the fact that Jonah was actually swallowed by the fish. The fact that there was enough air in the belly of the fish for him to breathe and stay alive for three days!
God is still the Lord of creation, and uses His creation in His way to fulfill His plans and purposes, in His perfect timing. It must have been very unpleasant for Jonah to be swallowed by this sea creature. But it had the effect God wanted, Jonah repented and prayed.
Part of the plan of God was accomplished once the sailors recognized that God is the Lord of land and sea. They even prayed to the God of Jonah before throwing him over the side. They expected Jonah to die and did not want to be guilty of his murder.
The captain of the ship found Jonah asleep and woke him with a request to call on his God for safety! This prophet must have been frustrated with that request! The very thing he did not want to do was talk to God. But he obviously followed the captain upstairs.
Having achieved the first part of his project, relief helped Jonah to sleep! Running away from God can be a tiring thing to do! Where was Jonah hoping to run to? He knew without a doubt that God could see him wherever he went, that there was nowhere to hide!
God uses storms for His purposes. In this case He used it to reveal Himself to the sailors. Each of them called on his own god, who did nothing. That was because Almighty God was in charge of this situation, and nothing could, or ever can, get in His way.
Many today act as though God lives in church buildings, and only there. They act religiously when they are in churches or cathedrals, and then do what they like elsewhere. We must remember that God sees and hears EVERYTHING that goes on. He is the ALL seeing, ALL hearing God.
Jonah features in many books about the Bible. It is an easy story to illustrate, but it is not just a story, it is truth! Jesus confirmed that for us in Matthew 12:40 when He used Jonah inside the fish to illustrate His own future 3 days in the tomb.