The Messenger of Allah ﷺ said, "The supplication of any one of you will be answered, so long as he does not become impatient and say, 'I have prayed, but no answer has been given to me.'"
حدثنا القعنبي عن مالك عن ابن شهاب عن أبي عبيد
أن رسول الله ﷺ قال يستجاب لأحدكم ما لم يعجل فيقول قد دعوت فلم يستجب لي
Bukhari narrated it in the Book of Supplications, chapter "The supplication of the servant is answered as long as he does not grow impatient," hadith no. 6340, and Muslim in the Book of Remembrance and Supplication, chapter explaining that the supplication of the one who prays is answered as long as he does not grow impatient, hadith no. 2735, both from the hadith of Malik through this same chain. It is also found in Muwatta (Yahya) 1/213, (Abu Musab, hadith no. 618, and Ibn Qasim, p. 129).