If a person abandons what is of Benefit, he/she will be put to trial with what is harmful
In The Name of Allaah, The Most Merciful, The Bestower of Mercy
Imaam Sadi (rahimahullaah) stated:
The Qur’aan has shown in a number of verses that one will be put to trial through preoccupying himself with what will harm him when he abandons what is of benefit, whilst having ability to reach that. And he will be prevented from reaching the first affair (i.e. the benefit he abandoned in the first place). This is found in a number of verses that when the polytheists shunned the worship of Ar-Rahmaan [The Most Merciful (Allaah)], they were put to trial with the worship of images (idols)
And when they displayed haughtiness (with regards to not obediently submitting to the command of the Messengers) and claimed that the Messengers were (only) humans, they were put to trial through submitting to everything that made (their) intellect and Religion shaky.
And when Eemaan was clearly shown to them at the first instance and they recognized (it), but then abandoned it, Allaah (Glorified Be He) diverted, afflicted and sealed their hearts. So, they did not believe until they perceived the painful punishment.
And after the straight path was clarified for them and they deviated from it by choice- approving the path of deviation in opposition to the path of guidance, they were punished. Allaah deviated their hearts and caused them to be confounded in their path.
And when they belittled the signs of Allaah and His Messengers, Allaah belittled them with a humiliating punishment.
And when they displayed haughtiness (with regards to not submitting to the truth), Allaah humiliated them in this life and the next.
And when they forbade that Allaah’s Name be glorified and mentioned in the Mosques of Allaah and strive for their ruin, then it was not fitting after that they should enter it except in fear.
وَمِنْهُم مَّنْ عَاهَدَ اللَّهَ لَئِنْ آتَانَا مِن فَضْلِهِ لَنَصَّدَّقَنَّ وَلَنَكُونَنَّ مِنَ الصَّالِحِينَ
فَلَمَّا آتَاهُم مِّن فَضْلِهِ بَخِلُوا بِهِ وَتَوَلَّوا وَّهُم مُّعْرِضُونَ
فَأَعْقَبَهُمْ نِفَاقًا فِي قُلُوبِهِمْ إِلَىٰ يَوْمِ يَلْقَوْنَهُ بِمَا أَخْلَفُوا اللَّهَ مَا وَعَدُوهُ وَبِمَا كَانُوا يَكْذِبُونَ
”And of them are some who made a covenant with Allaah (saying): ”If He bestowed on us of His Bounty, we will verily give Sadaqah (Zakat and voluntary charity in Allaah’s cause) and will be certainly among those who are righteous. ”Then when He gave them of His Bounty, they became niggardly [refused to pay the Sadaqah (Zakat or voluntary charity)], and turned away, averse. So He punished them by putting hypocrisy into their hearts till the Day whereon they shall meet him, because they broke that (covenant with Allaah) which they had promised to Him and because they used to tell lies’’ (9:75-77)
The verses (conveying) this meaning are numerous. And in such (verses) is that the slave was close to being guided and made to traverse the straight path, but then he abandoned it after knowing it, and renounced it after having traversed upon it, so he is punished and has no right to guidance. This is a recompense for his actions, as Allaah said about the Yahood:
وَلَمَّا جَاءَهُمْ رَسُولٌ مِّنْ عِندِ اللَّهِ مُصَدِّقٌ لِّمَا مَعَهُمْ نَبَذَ فَرِيقٌ مِّنَ الَّذِينَ أُوتُوا الْكِتَابَ كِتَابَ اللَّهِ وَرَاءَ ظُهُورِهِمْ كَأَنَّهُمْ لَا يَعْلَمُونَ
وَاتَّبَعُوا مَا تَتْلُو الشَّيَاطِينُ عَلَىٰ مُلْكِ سُلَيْمَانَ
”And when there came to them a Messenger from Allaah (i.e. Muhammad) confirming what was with them, a party of those who were given the Scripture threw away the Book of Allaah behind their backs as if they did not know! They followed what the (devils) gave out (falsely of the magic) in the lifetime of Sulaymaan”. 2:101-102
They abandoned the most sublime, the most beneficial and the most truthful of the Books (i.e. the Qur’aan), so Allaah put them to test with following that which is the most debased, most untruthful, and most harmful.
Those who wage war against Allaah and His Messenger abandon spending their wealth in obedience to Allaah, and (instead) spend it in obedience to shaytaan.
[Source: ”Al Qawaa-idul Hisaan Li-tafseer Al Qur’aan” of Imaam Abdur Rahmaan As-Sadi. Page: 96-97. Slightly paraphrased]