Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:68:48

Then be patient for the decision of your Lord, ˹O Muhammad˺, and be not like the companion of the fish when he called out while he was distressed.  

So await patiently the judgement of your Lord, regarding them in the way that He wills, and do not be like the one of the whale, in terms of impatience and haste — this is Jonah, peace be upon him — who called out, ˹who˺ supplicated his Lord, choking with grief, filled with anguish inside the belly of the whale.
القرآن:٦٨:٤٨

فَاصْبِرْ لِحُكْمِ رَبِّكَ وَلَا تَكُنْ كَصَاحِبِ الْحُوتِ إِذْ نَادَىٰ وَهُوَ مَكْظُومٌ  

{فاصبر لحكم ربك} فيهم بما يشاء {ولا تكن كصاحب الحوت} في الضجر والعجلة وهو يونس عليه السلام {إذ نادى} دعا ربه {وهو مكظوم} مملوء غما في بطن الحوت.