The Prophet salla’Allahu ‘alayhi wasalam said

“Call unto Allah with certainty that your call will be answered. And know that Allah does not answer a supplication which comes from a heedless and distracted heart.”

(Tirmidhi)