The Messenger of Allah ﷺ said, "Whoever wishes that Allah respond to him in times of hardship and distress, let him supplicate abundantly in times of ease."
حدثنا محمد بن مرزوق حدثنا عبيد بن واقد حدثنا سعيد بن عطية الليثي عن شهر بن حوشب
قال رسول الله ﷺ من سره أن يستجيب الله له عند الشدائد والكرب فليكثر الدعاء في الرخاء
[Hasan] Tabarani transmitted it, and Mizzi, by the same route, in Tahzib Kamal 7/266, and likewise Ibn Adi in 5/1990, from the hadith of Ubaydullah bin Waqid, and he is daif. It has a corroborating witness in Hakim 1/544, who graded it sahih, and Dhahabi agreed with him.