I heard the Messenger of Allah ﷺ say, "There is no one who makes a supplication but that Allah grants him what he asked for, or wards off from him an equivalent harm, so long as he does not supplicate for something sinful or for the severing of family ties."
حدثنا قتيبة بن سعيد حدثنا ابن لهيعة عن أبي الزبير
سمعت رسول الله ﷺ يقول ما أحد يدعو بدعاء إلا آتاه الله ما سأل أو كف عنه من السوء مثله ما لم يدع بإثم أو بقطيعة رحم
Its chain of transmission is hasan. The hadith was narrated by Muslim, 4/2096, no. 2735, in the Book of Remembrance, on the statement that the supplication of the one who prays is answered so long as he is not hasty, and Tirmidhi, 5/462, no. 3381, in the Book of Supplication, on what is mentioned that the supplication of the Muslim is answered, and Ibn Majah, 2/1277, no. 3881, in the Book of Supplication, on what one says upon waking during the night. Hakim graded it sahih, 1/493, and Dhahabi agreed with him.