Is a prayer accepted when one prays sincerely? If a person trusts Allah fully for something that he desires very much, will Allah give it to him immediately?
Dua (prayer) is a kind of worship. The main principle in prayers should be the aim of worshipping. It is wrong to regard prayer as something that needs to be accepted and something as a petition.
Sometimes, a person prays but what he wants is not accepted seemingly. However, we should not give up prayers in that case. If what is asked is obtained and if God Almighty accepts the prayer, it is much better, of course. However, even if it is not accepted seemingly, one should not say, “my prayer was not accepted.” On the contrary, it is necessary to say, “Allah accepted my prayer in a better way for my hereafter or in this world.”
In fact, we need to say, “this prayer was not in vain; I will be rewarded for it in the hereafter because it is a kind of worship”; we should not give up prayers but try to pray more.
God Almighty states the following in the Quran: “Call on Me; I will answer your prayer.” (al-Mu’min, 40/60) Acting upon this verse, some people say, “Since Allah said, ‘Call on Me; I will answer your prayer’, why are our prayers not accepted although we pray a lot? The scholars state the following regarding the issue: “In the verse, Allah says, ‘I will answer’; He does not say, ‘I will accept’. If you go to a doctor and say to him, ‘Give me this and that medicine’, the doctor will answer you. However, if the medicine is not useful or if it is harmful, he will give you a better medicine.
Similarly, God Almighty, who has absolute wisdom, answers us and our prayers. However, accepting our prayers is related to His wisdom; He sometimes gives us exactly what we want; but He sometimes gives us a better one; and sometimes, He does not give anything because He knows it is harmful for us.
After this short explanation, let us have a look at the conditions for the acceptance of a prayer:
First of all, the prayer needs to be something acceptable. The mouth that utters the prayer needs to be sincere and sinless. If possible, the person needs to have wudu; he needs to eat halal food. Prayers uttered in holy places, especially in mosques, at holy times, especially in Ramadan, on holy nights like the Night of Qadr (Power), the Night of Barat, after prayers, especially after the morning prayer are more acceptable by the divine wisdom and divine mercy.
When the prayer is away from those conditions, the prayer will be less effective.