Narrated 'Abdullah: It is a sign of having knowledge that, when you do not know something, you say: 'Allah knows better'. Allah said to his Prophet: 'Say: No wage do I ask of you for this (Qur'an), nor am I one of the pretenders (a person who pretends things which do not exist)' (38:86) When the Quraish troubled and stood against the Prophet ﷺ he said, "O Allah! Help me against them by afflicting them with seven years of famine like the seven years of Joseph". So they were stricken with a year of famine during which they ate bones and dead animals because of too much suffering, and one of them would see something like smoke between him and the sky because of hunger. Then they said: Our Lord! Remove the torment from us, really we are believers. (44:12) And then it was said to the Prophet (by Allah), "If we remove it from them. they will revert to their ways (of heathenism)". So the Prophet ﷺ invoked his Lord, who removed the punishment from them, but later they reverted (to heathenism), whereupon Allah punished them on the day of the Battle of Badr, and that is what Allah's Statement indicates: 'Then watch for the day that the sky will bring forth a kind of smoke plainly visible.we will indeed (then) exact retribution'. (44:10).
This hadith teaches us that knowledge is important as it helps us recognize our mistakes and ask forgiveness from God; it also teaches us that if we turn to Him in times of difficulty He will answer our prayers; however if after receiving His mercy we go back to our old ways then there will be consequences for our actions. We must always remember that God is all-knowing and all-powerful so no matter what situation arises if we have faith in Him then everything will be alright in the end.