The Messenger of Allah said: “Whoever wishes that Allah would respond to him during hardship and grief, then let him supplicate plentifully when at ease.”
Jami` at-Tirmidhi Book 48, Hadith 13