The first condition is supplication and hope. Indeed, calling upon Allah is something commanded of us and promised a response as Allah said:
And your Lord said, "Call upon Me, I will answer you."
[Surah Ghaafir, 40:60]
Additionally, in the four famous collections of Hadith (An-Nasai, Abu Daawood, At- Tirmidhee, & Ibn Majah), An-Numaan Ibn Basheer narrated that the Prophet said:
"Indeed, supplication – it is worship." (An-Numaan continues) "Then he recited this (the previous) verse."
However, supplication only necessitates a response when its conditions are fulfilled, and anything that prevents the response is avoided. The response may be delayed or withheld due to some of its conditions not met or because of some things or etiquettes which prevent one’s supplication from being answered.3 From the greatest of these conditions is that the caller must put his full heart into his supplication and have certain hope in Allah answering him as in the Hadith of Abu Hurairah that the Prophet said:
Call upon Allah while you are certain of (His) response. And know that Allah does not accept the supplication from a careless, inattentive heart. For this (the fact that you must be certain of a response), the servant has been forbidden to say in his supplication:
Let no one of you say, "Oh Allah, forgive me if You want. Oh Allah, have mercy on me if You want. (Rather,) he should be certain and determined in supplicating, for surely Allah does whatever He wills – there is no forcing or compelling Him anyway."
A person is also not allowed to be hasty and therefore stop calling upon Allah if the response he wishes for is not immediate. This is one of the things that prevent supplications from being answered so that the servant does not lose hope in having his supplication answered, even if time passes. Certainly, Allah loves those who are persistent and intent upon always supplicating to Him.
And call upon Him in fear and aspiration. Indeed, the mercy of Allah is near to those who do good.
[Surah Al-‘Araaf, 7:56]
So as long as the servant persists in calling upon Allah, aspiring for a certain response without losing hope, then he is then close to his response. And whoever consistently knocks on the door will eventually have it opened to him. From the most important things a servant could ask his Lord for is the forgiveness of his sins and what that implies is being saved from the Fire and entering Paradise.
The Prophet said:
In general, it is about that (the Fire & Paradise) that we constantly supplicate for.
Abu Muslim Al-Khawlani said, "I never made a supplication in which I mentioned the Fire except that I ended up making it (the supplication) totally for seeking protection from it." From the Mercy of Allah towards His servant is that whenever a servant calls upon Him, seeking help with any of his needs of this world, He assists him with it and exchanges it for something better. He may, as a response to his call, either prevent some harm from befalling him, or save the response and reward for him in the Hereafter, or He may forgive, due to it (his supplication), one of his sins.
Imaam Ahmad records in "Al-Musnad" a Hadith from Abu Sa’eed that the Prophet said:
There is no Muslim that makes a supplication, as long as it does not pertain to anything sinful or the cutting of ties with one’s kinship, except that Allah will give him due to it one of three things. Either He will immediately respond to his supplication, or He will save it (its reward) for him in the Hereafter, or He will prevent a similar evil from befalling him. The companions said, "Then we will increase (in supplication)".
The Prophet replied:
Allah will (also) increase.
In any case, remaining persistent and diligent in supplicating for forgiveness while hoping in Allah is the way to obtaining this forgiveness. Also from the greatest means to obtain forgiveness is that whenever the servant commits a sin, he neither seeks nor hopes for anyone’s forgiveness other than from his Lord. He knows that no one forgives sins or takes people to account for them other than Allah.
As for Allah’s saying (in the first Hadith on pg. 3), "As long as you call upon Me and hope in Me, I will forgive you for whatever (deeds are) with you and I will not mind." This means: No matter how numerous your sins and misdeeds may be, that (forgiveness) will not be something too great for Me nor will I consider it too much. As recorded in "Sahih Muslim", the Prophet said:
When anyone of you supplicates, let him not say, "Oh Allah, forgive me if You want." Rather, let him be resolved and certain in his request and let him increase his hope and enthusiasm, for Allah – nothing is too great for Him.
So the sins of a servant, regardless of how great and numerous they may be, definitely the pardon and forgiveness of Allah is much greater. Such sins are absolutely insignificant when compared to the pardoning and forgiving of Allah. Someone said (in poetry form): My Lord, although my sins are grave and numerous, I have already known Your forgiveness is greater. If only a good-doer hopes in You, then whom does the sinner call upon and hope in? I have no way to You except by hope in the beauty of Your forgiveness and the fact I am a Muslim.