Abu Hurairah (May Allah be pleased with him) reported: The Messenger of Allah (PBUH), “The supplication of every one of you will be granted if he does not get impatient and say (for example): `I supplicated my Rubb but my prayer has not been granted’.” [Al-Bukhari and Muslim].

The narration of Muslims is: “The supplication of a slave continues to be granted as long as he does not supplicate for a sinful thing or for something that would cut off the ties of kinship and he does not grow impatient.” It was said: “O Messenger of Allah! What does growing impatient mean?” He (PBUH) said, “It is one’s saying: `I supplicated again and again but I do not think that my prayer will be answered.’ Then he becomes frustrated (in such circumstances) and gives up supplication altogether.

Abu Umamah (May Allah be pleased with him) reported: The Messenger of Allah (PBUH) was asked: “At what time does the supplication find the greatest response?” He (PBUH) replied, “A supplication made during the middle of the last part of the night and after the conclusion of the obligatory prayers.” [At-Tirmidhi].

`Ubadah bin As-Samit (May Allah be pleased with him) said: The Messenger of Allah (PBUH) said, “Whenever a Muslim supplicates Allah, He accepts his supplication or averts any similar kind of trouble from him until he prays for something sinful or something that may break the ties of kinship.” Upon this, someone of the Companions said: “Then we shall supplicate plenty.” The Messenger of Allah (PBUH) said, “Allah is more plentiful (in responding).
[At-Tirmidhi].

Commentary:  We learn from this Hadith that prayer (supplication) is beneficial to us in any case, because Almighty Allah either grants the prayer we make, or if the supplication is not being accepted, He removes some future trouble that was destined for us, or He grants us in full in the Hereafter.

A Muslim should never feel shy of praying to Allah. In fact, he should persistently pray because there is no end to His Treasures.

Ibn `Abbas (May Allah be pleased with them) said: The Messenger of Allah (PBUH) used to say when he was in distress: “La ilaha illallahul-Azimul-Halim. La ilaha illallahu Rabbul-`Arshil-`Azim. La ilaha illallahu Rabbus-samawati, wa Rabbul-ardi, wa Rabbul-`Arshil-Karim. (None has the right to be worshiped but Allah the Incomparably Great, the Compassionate. None has the right to be worshiped but Allah the Rubb of the Mighty Throne. None has the right to be worshiped but Allah the Rubb of the heavens, the Rubb of the earth, and the Rubb of the Honorable Throne).”
[Al-Bukhari and Muslim].

Commentary: The only medicine in a time of distress is the remembrance of Allah Whose Help alone should be sought. This Du`a contains words that glorify Allah and exalt Him far above all else. It is desirable to recite these words when one is in distress as this is exactly what the Prophet (PBUH) used to recite in such situations