All mighty Allaah (SWT) said :

“And when My slaves ask you (O Mohammed) concerning Me then (answer them), I am indeed near (to them by my knowledge) I respond to the invocations of the supplicant when he calls on me (without any mediator or intercessor) So let them obey Me and believe in Me, so that they may be led to the right path.” (Qur’an 2:186)

The Prophet (SAW) was asked by some of his companions: “Is Allah near so we invoke him or is he far so we call him? so Allah revealed this verse, – Allah (SWT) is near He can hear the supplicant anytime anywhere and respond to him if the supplicant invokes Allah (SWT) with a sincere heart and avoid interdictions of supplication.

Allaah (SWT) also said:

“Invoke your Rabb (Cherisher and Sustainer) with humility and in secret, He likes not the aggressors.” (Qur’an 7:55)

Supplication is of two kinds. One is worship and the other is a request. So He commands to be invoked with humility which is insisting in request and continuously in worship and “secretly” not loud to avoid “Ryea” (showing off)

Allaah (SWT) also said:

“And your Rabb (Cherisher and Sustainer) said: “Invoke Me (i.e. believe in My Oneness) (and ask Me for anything) I will respond to your (invocation) Verily! Those who scorn My worship (i.e. do not invoke Me, and do not believe in My Oneness ) they will surely enter hell in humiliation!” (Qur’an 40:60)

Allaah (SWT) said:

“Invoke Me, I will respond to you” , so from His mercy for His slaves He has promised to respond to their invocations but for those who do not invoke Him, He has promised punishment because invocation of Allah (SWT) is an act of worship and refusing to invoke Him ( disbelieving in Him or having doubt in His ability to answer the invocation) is refusal to worship Him.