Praise be to Allah.
Part of the etiquette of supplication (du’aa’) and one of the means of attaining a response is to think positively of Allah and believe that Allah will answer his supplication and will never disappoint, because of the report narrated by at-Tirmidhi (3479) from Abu Hurayrah, who said: The Messenger of Allah (blessings and peace of Allah be upon him) said: “Call upon Allah, being certain of a response, and know that Allah will not answer a supplication from a negligent and heedless heart.” This hadith was classed as hasan by al-Albaani in Saheeh at-Tirmidhi.
It says in Tuhfat al-Ahwadhi (9/316): The words “being certain of a response” mean: when you are certain of that, meaning that when you offer the supplication, you are in a state in which you are deserving of an answer, in the sense that you are doing what is right and avoiding what is wrong; paying attention to the conditions of supplication, such as presence of mind and choosing the best times and places; and making the most of appropriate situations such as prostration, and so on, so that you think it more likely that the supplication will be answered rather than rejected.
Or it means: when you believe that Allah will not disappoint you, because of His abundant generosity, perfect might and all-encompassing knowledge, so that you are hoping for a response and sincere in your supplication, because unless the hope of the supplicant is firm, his supplication will not be sincere. End quote.
The believer does not doubt the might of Allah, may He be exalted, because doubting the might of Allah constitutes disbelief. But he may think that Allah will never answer his supplication because he does not deserve an answer, for example, or he does not fulfil the conditions of supplication being accepted.
So he should stop thinking like this, and focus with all his heart on his Lord, and he should have great hope and be optimistic, because Allah is as His slave thinks He is, as it says in the hadith; at the same time, he should strive to fulfil the conditions of supplication being answered.
Al-Qurtubi said in al-Mufhim: It was said that what is meant by “as My slave thinks I am” is his thinking that he will receive an answer when he offers supplication, and thinking that it will be accepted when he repents, and thinking that he will be forgiven when he seeks forgiveness, and thinking that he will be rewarded when he does an act of worship and fulfils all its conditions, trusting that Allah’s promise is true. This is supported by the Prophet’s words in another hadith: “Call upon Allah, being certain of a response”.
He said: Hence the individual should strive hard to do what is required of him, trusting that Allah will accept it and forgive him, because He has promised that and He does not break His promise. If the individual believes or thinks that Allah will not accept it, and that it will not benefit him, this is despairing of the mercy of Allah, which is a major sin; whoever dies in that state will be left to what he thought, as it says in some versions of the hadith mentioned above: “So let My slave think of Me as he wishes.”
He said: As for thinking that one will be forgiven whilst persisting in sin, this is pure ignorance and heedlessness, and it is more akin to the way of thinking of the Murji’ah.
End quote from Tuhfat al-Ahwadhi (7/54).
For information on the conditions of supplication being answered, and the impediments to that, please see the answers to questions no. 13506, 5113 and 130713.
With regard to your saying when calamities are ongoing, “if calamities happen, I will accept the divine decree, in the hope that the ultimate outcome will be good”, this is not regarded as doubting the power of Allah, may He be exalted; rather it is acknowledging the power of Allah, may He be exalted, thinking positively of Him and hoping that the ultimate outcome will be good.
It should be noted that if the response is slow in coming, and what the person asked of his Lord does not happen, this comes under the heading of trials with which Allah tests His slaves and tests their patience and faith in Him.
We have quoted some beneficial words from Imam Ibn al-Jawzi (may Allah have mercy on him) concerning this matter in the answer to question no. 127017.
So ignore the persistent thoughts (waswaas), and continue to call upon Allah, may He be exalted, and ask of Him, for He answers the supplication of the one who is in distress, and He loves those who persist in supplication. If someone continues to knock at the door, it will soon be opened to him.
May Allah enable us and you to obey Him and attain His pleasure.
See also the answer to question no. 126946.
And Allah knows best.