Here I partially draw on the thoughts of Dr Phil Fernandes of the Institute of Biblical Defense. As an aside, apparently in Biblical times a whale was considered to be a fish and not an aquatic mammal. The sea creature that swallowed Jonah after he was thrown overboard is described as a "great fish." Some critics who question the veracity of the Jonah story hold that it is impossible for a human being to be swallowed by a fish and survive for any length of time inside its stomach. Dr Fernandes referred to a story of a nineteenth century whaler being swallowed by a whale. The whale was later caught, and the man cut of its stomach. He was still alive, but his skin was bleached white and bodily hair dissolved from its stomach acids. I don't know if this story is true. Even so, Jesus referred to Jonah (Matthew 12:39-42, Luke 11:29-32). Jesus must be taken at his word, so therefore it must have happened. Jonah's experience symbolically foreshadowed Jesus's death and resurrection.
Jonah shows us the consequences of disobeying God. God gave Jonah a clear command, but he disobeyed it. In the end, after he repented, God gave him a second chance. In the same way, He will also give a second chance to truly repentant disobedient Christians. Too many Christians these days take their salvation for granted, and think that God is obligated to forgive their sins, so they can live however they like. While it's impossible for us to live sinless lives on this side of eternity, the Holy Spirit enables us to live lives that honour God, and we cannot do that in our own power. We should live each day in humble reliance upon His grace and mercy.