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:21:83

And ˹mention˺ Job, when he called to his Lord, "Indeed, adversity has touched me, and you are the Most Merciful of the merciful."  

And, mention, Job (Ayyūba, is substituted by ˹the following, idh nādā rabbahu …˺) when he called out to his Lord — after he had been afflicted with the loss of all of his possessions and children, the laceration of his body, his being shunned by all except his wife, for a period of thirteen, seventeen, or eighteen years, as well as ˹the affliction of enduring˺ a straitened means of livelihood — ‘Indeed (read annī because of the implicit yā’ ˹of the first person pronoun˺) harm, adversity, has befallen me, and You are the Most Merciful of the merciful’.
القرآن:٢١:٨٣

وَأَيُّوبَ إِذْ نَادَىٰ رَبَّهُ أَنِّي مَسَّنِيَ الضُّرُّ وَأَنْتَ أَرْحَمُ الرَّاحِمِينَ  

{و} اذكر {أيوب} ويبدل منه {إذ نادى ربه} لما ابتلي بفقد جميع ماله وولده وتمزيق جسده وهجر جميع الناس له إلا زوجته سنين ثلاثا أو سبعاً أو ثماني عشرة وضيق عيشه {أني} بفتح الهمزة بتقدير الياء {مسنيَ الضر} أي الشدة {وأنت أرحم الراحمين}.

See similar narrations below:

Collected by Aḥmad's Zuhd
ahmad-zuhd:1614ʿAbdullāh > Abū Maʿmar > Ibn ʿUlayyah > Rabīʿah b. Kulthūm b. Jabr

[Machine] I entered upon Al-Hasan while he was complaining about his tooth and saying, "{When he called to his Lord, 'Indeed, I am touched by hardship, and you are the most merciful of the merciful.'" (Quran 21:83).  

الزهد لأحمد:١٦١٤حَدَّثَنَا عَبْدُ اللَّهِ حَدَّثَنَا أَبُو مَعْمَرٍ حَدَّثَنَا ابْنُ عُلَيَّةَ عَنْ رَبِيعَةَ بْنِ كُلْثُومِ بْنِ جَبْرٍ قَالَ

دَخَلْتُ عَلَى الْحَسَنِ وَهُوَ يَشْتَكِي ضِرْسَهُ وَهُوَ يَقُولُ {إِذْ نَادَى رَبَّهُ أَنِّي مَسَّنِيَ الضُّرُّ وَأَنْتَ أَرْحَمُ الرَّاحِمِينَ} [الأنبياء 83]