Anas bin Malik reported,

The Messenger of Allah ﷺ visited a Muslim man who had grown so frail that he resembled a baby chick. The Messenger of Allah ﷺ asked him, "Were you supplicating for something, or asking Allah for anything?"The man replied, "Yes. I used to say, 'O Allah, whatever punishment You have prepared for me in the Hereafter, hasten it for me in this world.'"The Messenger of Allah ﷺ said, "Glory be to Allah! You cannot bear it, you have no strength for it. Why did you not instead say, 'O Allah, grant us good in this world and good in the Hereafter, and protect us from the punishment of the Fire'?"He then prayed to Allah for the man, and Allah cured him.

Azami 3483

Sahih

عن أنس

أن رسول الله ﷺ عاد رجلا من المسلمين قد خفت فصار مثل الفرخ. فقال له رسول الله ﷺ: هل كنت تدعو بشيء، أو تسأله إياه قال: نعم. كنت أقول: اللهم ما كنت معاقبي به في الآخرة فعجله لي في الدنيا فقال رسول الله ﷺ: سبحان الله لا تطيقه- أو لا تستطيعه- أفلا قلت: اللهم آتنا في الدنيا حسنة، وفي الآخرة حسنة وقنا عذاب النار قال: فدعا الله له فشفاه.

الأعظمي 3483صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Funerals
Chapter
Visiting the sick
Section
Warning against one who supplicates upon himself for hastening punishment in this world
Numbering
Jami al-Kamil 3483 (2nd edition)
Azami 3483