The Messenger of Allah ﷺ said, "The supplication of any one of you will be answered as long as he does not become impatient and say, 'I have prayed and my prayer has not been answered.'"
أن رسول الله ﷺ قال: يستجاب لأحدكم ما لم يعجل فيقول: قد دعوت فلم يستجب لي.
Malik related it in the Quran (29), from Ibn Shihab, from Abu Ubayd the freedman of Ibn Azhar, from Abu Hurairah, who narrated it. Bukhari related it in the Book of Supplications (6340), and Muslim in the Book of Remembrance and Supplication (2735:90), both of them by way of Malik in the same manner.