Muhammad bin al-Muthanna narrated to us, Khalid bin Harith narrated to us, from Humayd, from Thabit, from Anas bin Malik, that the Prophet ﷺ visited a man who had become so emaciated that he resembled a fledgling chick.The Prophet ﷺ asked him, "Did you not used to make supplication? Did you not used to ask your Lord for well-being?"The man replied, "I used to say, 'O Allah, whatever punishment You would inflict upon me in the Hereafter, hasten it for me in this world.'"The Prophet ﷺ said, "Glory be to Allah! You cannot bear it, nor are you able to endure it. Why did you not say, 'O Allah, grant us good in this world and good in the Hereafter, and protect us from the punishment of the Fire'?"
حدثنا محمد بن بشار حدثنا سهل بن يوسف حدثنا حميد عن ثابت البناني
ح و حدثنا محمد بن المثنى حدثنا خالد بن الحارث عن حميد عن ثابت عن أنس بن مالك أن النبي ﷺ عاد رجلا قد جهد حتى صار مثل الفرخ فقال له أما كنت تدعو أما كنت تسأل ربك العافية قال كنت أقول اللهم ما كنت معاقبي به في الآخرة فعجله لي في الدنيا فقال النبي ﷺ سبحان الله إنك لا تطيقه أو لا تستطيعه أفلا كنت تقول اللهم آتنا في الدنيا حسنة وفي الآخرة حسنة وقنا عذاب النار
Muslim also narrated it in the Book of Remembrance and Supplication, Chapter on the dislike of supplicating for the hastening of punishment in this world, hadith no. 2688, from the hadith of Khalid bin Harith, with the same wording.