The Command to be Patient and to refrain from being Hasty like Yunus was
Allah says,
فَاصْبِرْ لِحُكْمِ رَبِّكَ
So wait with patience for the decision of your Lord,
`O Muhammad, persevere against the harm your people cause you and their rejection. For verily, Allah will give you authority over them, and make the final victory for you and your followers in this life and the Hereafter.'
وَلَا تَكُن كَصَاحِبِ الْحُوتِ
and be not like the Companion of the Fish,
meaning, Dhun-Nun, who was Yunus bin Matta, when he went off angry with his people. Various things happened to him, such as riding on a ship at sea, being swallowed by a (large) fish, the fish carrying him off into the ocean, being in the darkness and depth of the sea and hearing the sea's and its dwellers glorification of the Most High, the Most Able (Allah). For He (Allah) is the One Whose execution of divine decree cannot be resisted. After all of this, he (Yunus) called out from the layers of darkness,
أَن لاَّ إِلَـهَ إِلاَّ أَنتَ سُبْحَـنَكَ إِنِّى كُنتُ مِنَ الظَّـلِمِينَ
"That none has the right to be worshipped but You (O Allah), Glorified (and Exalted) are You! Truly, I have been of the wrongdoers." (21;87)
Then Allah said concerning him,
فَاسْتَجَبْنَا لَهُ وَنَجَّيْنَـهُ مِنَ الْغَمِّ وَكَذلِكَ نُنجِـى الْمُوْمِنِينَ
So We answered his call, and delivered him from the distress. And thus We do deliver the believers. (21;88)
Allah also says,
فَلَوْلَا أَنَّهُ كَانَ مِنَ الْمُسَبِّحِينَ
لَلَبِثَ فِى بَطْنِهِ إِلَى يَوْمِ يُبْعَثُونَ
Had he not been of them who glorify Allah, he would have indeed remained inside its belly (the fish) till the Day when they are resurrected. (37;143,144)
So here (in this Surah), Allah says,
إِذْ نَادَى وَهُوَ مَكْظُومٌ
when he cried out (to Us) while he was Makzum.
Ibn Abbas, Mujahid and As-Suddi, all said, "while he was distressed."
لَوْلَا أَن تَدَارَكَهُ نِعْمَةٌ مِّن رَّبِّهِ لَنُبِذَ بِالْعَرَاء وَهُوَ مَذْمُومٌ