God, the All-Mighty, Merciful and Compassionate, revealed in the Qur'an that He is close to man and will answer people when they pray to Him. One of the relevant verses is as follows:
If My servants ask you about Me, I am near. I answer the call of the caller when he calls on Me. They should therefore respond to Me and believe in Me so that they will be guided aright. (Surat al-Baqara: 186)
As stated in the verse above, God is close to everybody. He has knowledge of everyone's wishes, feelings, thoughts, every word uttered, anything whispered and even what is concealed deep in one's thoughts. Consequently, God hears and knows everyone who turns to Him and prays to Him. This is God's blessing on mankind, and a manifestation of His mercy, grace and infinite power.
God has infinite might and knowledge. He is the Possessor of everything in the entire universe. Every being, every object, from the seemingly most powerful people to the greatest riches, from the magnificent celestial bodies to a tiny animal dwelling on the Earth, all belongs to God and are all under His complete will and control.
A person who has faith in this truth can pray to God for anything and can hope that God will answer those prayers. For example, a person who is seized by an incurable disease will surely resort to all forms of medical care. Yet, knowing that only God restores health, prayers will be offered to Him for recovery. Alternatively, a person with some kind of fear or anxiety can pray to God for relief and to remove all forms of fear. A person who encounters difficulties in accomplishing a task can turn to God for the removal of difficulties. One can pray to God for countless things; for guidance to the true path, for acceptance into paradise with other true believers, for a better grasp of paradise, hell and the Might of God, for good health and so on. This is what God's Messenger, peace be upon him, stressed when he said:
Shall I introduce to you a weapon which will protect you both from the evils of enemies and increase your sustenance? They said: Yes, O Messenger of God. He said: Call your Lord day and night, for 'Prayer' is the weapon of a believer.1
However, there is another secret disclosed in the Qur'an, which deserves mention at this point. As God states in the verse, "Man prays for evil just as he prays for good. Man is prone to be impetuous." (Surat al-Isra': 11). For example, a person may ask God for more property and wealth for his children's future. However, God may not see any goodness in this request. It may well be that prosperity will turn the children away from God. In this sense, God hears this person's call and answers it in the best way. Alternatively, a person may pray not to be late for an appointment. However, it may well be that it is better for him to reach the destination after the specified time and instead, meet someone who would contribute something beneficial for his eternal life. God knows this and He answers the prayer, not in the form the person thought, but in the best way. That is, God hears that person, but if He sees no good for him in his prayer, He creates what is best for him. This itself is a very important secret.
When prayers appear to go unanswered, those unaware of this secret assume that God did not hear their call. This is indeed a perverted belief of ignorance because "God is closer to man than his own jugular vein". (Surah Qaf: 16) He knows every word one speaks, every thought and every instant pertaining to one's life. Even while one is asleep, God knows what he experiences in his dreams. It is God Who creates everything. Consequently, each time one prays to God, he should be aware that God will accept his prayer as a worship and believe that God will answer his call in the most appropriate time and create what is best for him.
Prayer, as well as being a form of worship, is also a precious gift from God to mankind. This is because, through prayer, God enables man to attain anything He deems good and beneficial for him. God relates the importance of prayers in the verse stating: "Say: 'What has My Lord to do with you if you do not call on Him? But you have denied the truth, so punishment is bound to come.' " (Surat al-Furqan: 77)
1- Buyuk Hadis Kulliyati (Great Ahadith Collection), Jam-ul-fawaid min Jami'il-usul and Majma'iz-zawaid, Imam Muhammad Bin Muhammad Bin Sulayman ar-Rudani 52009-05-10 11:54:07