Dalil

Quran Fussilat 41:49

لَّا يَسۡـَٔمُ ٱلۡإِنسَٰنُ مِن دُعَآءِ ٱلۡخَيۡرِ وَإِن مَّسَّهُ ٱلشَّرُّ فَيَـُٔوسٞ قَنُوطٞ

Translation

Man is not weary of supplication for good [things], but if evil touches him, he is hopeless and despairing.