Source:Great Muslim Quotes
Remember Allah at times of ease, and He will remember you at times of hardship. For indeed, the Prophet Yunus would remember Allah constantly, and so when he was swallowed by the whale (he was rescued). And this is what Allah says:
‘And were it not for the fact that he was amongst those who glorified Allah (constantly); he would have remained in its stomach until the Day of Resurrection.’ (Surah al-Saffat; 143-144)
And the Pharoah was a tyrant who never remembered Allah. So when he was about to drown, and he proclaimed his belief, Allah said:
‘Now?! And you were disobedient before, and were amongst the transgressors?’ (Surah Yunus; 91)
(Al-Dhahak ibn Qays)