Ali bin Abu Talib reported,

I was ill, and the Messenger of Allah ﷺ passed by me while I was saying, "O Allah, if my appointed time has come, then grant me relief. If it is delayed, then raise my station. If this is a trial, then grant me patience."The Messenger of Allah ﷺ asked, "What did you just say?"So he repeated to him what he had said. Then he nudged him with his foot and said, "O Allah, grant him well-being," or "heal him." Shuba was the one uncertain about which word was used.After that, I never suffered from that ailment again.

Tirmidhi 3564

Hasan

حدثنا محمد بن المثنى حدثنا محمد بن جعفر حدثنا شعبة عن عمرو بن مرة عن عبد الله بن سلمة

عن علي قال

كنت شاكيا فمر بي رسول الله ﷺ وأنا أقول اللهم إن كان أجلي قد حضر فأرحني وإن كان متأخرا فارفغني وإن كان بلاء فصبرني فقال رسول الله ﷺ كيف قلت قال فأعاد عليه ما قال قال فضربه برجله فقال اللهم عافه أو اشفه شعبة الشاك فما اشتكيت وجعي بعد

الترمذي 3564حسن
Contents
Reference
Commentary
Ayat
Collection
Jami Tirmidhi
Book
Supplications
Chapter
Supplication of the sick
Numbering
Darussalam 3564
Tirmidhi 3564