The Messenger of Allah ﷺ said, "The supplication of one of you will be answered as long as he is not hasty."Someone asked, "Messenger of Allah, what does it mean to be hasty?"He replied, "He says, 'I have prayed to Allah, but Allah has not answered me.'"
حدثنا علي بن محمد حدثنا إسحق بن سليمان عن مالك بن أنس عن الزهري عن أبي عبيد مولى عبد الرحمن بن عوف
أن رسول الله ﷺ قال يستجاب لأحدكم ما لم يعجل قيل وكيف يعجل يا رسول الله قال يقول قد دعوت الله فلم يستجب الله لي
Bukhari transmitted it in the Book of Supplications, chapter "What Is Answered for the Servant as Long as He Does Not Grow Impatient," etc., no. 6340, and Muslim in the Book of Remembrance and Supplication, chapter "Explaining That the Supplication of One Who Calls Is Answered as Long as He Does Not Grow Impatient," no. 90/2735, from the hadith of Malik with this same wording, and it is in Muwatta 1/213.