The verse is to be understood according to its apparent meaning. The calamities and famines that Allaah decrees do not harm anyone but those whose lives have ended and whose provision has ceased. As for those who still have something left of their lives or provision, Allaah brings their provision to them by many ways, which they may know or may not know, because Allaah says (interpretation of the meaning):
“And whosoever fears Allaah and keeps his duty to Him, He will make a way for him to get out (from every difficulty).
3. And He will provide him from (sources) he never could imagine”
“And so many a moving (living) creature carries not its own provision! Allaah provides for it and for you”
And the Prophet (blessings and peace of Allaah be upon him) said: “No soul will die until it has received its provision in full and completed its allotted lifespan.”
A person may be punished with poverty and deprivation of provision because of his actions such as laziness and failing to seek means of provision that he is able to do, or because of his committing sins that Allaah has forbidden, as Allaah says (interpretation of the meaning):
“Whatever of good reaches you, is from Allaah, but whatever of evil befalls you, is from yourself”
“And whatever of misfortune befalls you, it is because of what your hands have earned. And He pardons much”
And it is narrated in a saheeh report that the Prophet (blessings and peace of Allaah be upon him) said: “A person may be deprived of provision because of a sin that he commits.” Narrated by Imam Ahmad, al-Nasaa’i and Ibn Maajah with a jayyid isnaad.
A person may be tested with poverty, sickness and other calamities so as to test his gratitude and patience, because Allaah says (interpretation of the meaning):
“And certainly, We shall test you with something of fear, hunger, loss of wealth, lives and fruits, but give glad tidings to As‑ Saabiroon (the patient).
156. Who, when afflicted with calamity, say: ‘Truly, to Allaah we belong and truly, to Him we shall return’”
“And We tried them with good (blessings) and evil (calamities) in order that they might turn (to Allaah’s Obedience)”
What is meant by good in this verse is blessings, and what is meant by evil is calamities. And the Prophet (blessings and peace of Allaah be upon him) said: “How wonderful is the affair of the believer, for all his affairs are good. If harm befalls him, he is patient and that is good for him, and if something good happens to him he is grateful and that is good for him, and this is not for anyone except the believer.” Narrated by Imam Muslim in his Saheeh.
And there are many similar verses and hadeeths. And Allaah is the source of strength. End quote.