One day the Messenger of Allah ﷺ said: “If a Muslim asks for something from Allah, Allah Most High will definitely grant his wish or He will remove evil from him in proportion to what He would have given him, as long as he does not ask for anything sinful or does not cut his relations with his relatives”
One of his Companions said: “In that case we desire many things from Allah”.
The Messenger of Allah ﷺ responded as such: “Allah’s grace is greater than the things you ask from Him” (Tirmidhi, Deavat, 115/3573; Ahmad, II, 18).
Almighty Allah does not reject sincere prayers. However He does not accept certain demands made that do not comply with Absolute Destiny, even though they may be asked for in complete sincerity. However, the slave should never give up and should continue to pray. This is because in those cases the response to the prayer has been deferred to the afterlife. Almighty Allah has said: “Your Lord says, “Call on Me and I will answer you” ( Mu’min, 23:60)
The Prophet Muhammad ﷺ said: “The prayer of the slave will be answered as long as he does not ask for something that will lead to sin or to his relations with his relatives being severed and if he is not impatient about the result”
He was asked: “O Messenger of Allah! What does it mean for him to be impatient (about the result)?”
The Messenger of Allah ﷺ said: “The slave says: “I keep praying but my Lord does not answer my prayer”. He gives up when his prayer is not answered immediately and he stops praying. (This is how he becomes impatient). (Muslim, Zikir, 92).
Likewise the prophet Zaccharia (Alaihi Salaam) prayed ““My Lord, do not leave me on my own…. (Anbiya, 21:89)
In saying so he asked for a son with the purpose of strengthening the religion, yet his prayer was only answered 40 years later in the form of the prophet Yahya (Alaihi Salaam).
One time the Messenger of Allah ﷺ saw a man in ritual prayer, who did not send blessings on the Prophet before he started supplicating. Upon this he said:
“This man was impatient (in a hurry)”. Then he called that man to him and said as a caution to his entire community: “Whenever one of you prays, let him first praise Allah Most High and then send blessings upon me. Then let him ask for whatever he so wishes” (Tirmidhi, Deavat, 64/3477).