وَاعْلَمُوا أَنَّ فِيكُمْ رَسُولَ اللَّهِ لَوْ يُطِيعُكُمْ فِي كَثِيرٍ مِّنَ الْأَمْرِ لَعَنِتُّمْ وَلَٰكِنَّ اللَّهَ حَبَّبَ إِلَيْكُمُ الْإِيمَانَ وَزَيَّنَهُ فِي قُلُوبِكُمْ وَكَرَّهَ إِلَيْكُمُ الْكُفْرَ وَالْفُسُوقَ وَالْعِصْيَانَ أُولَٰئِكَ هُمُ الرَّاشِدُونَ
And know that, among you there is the Messenger of Allāh (sallallāhu alaihi wa salam). If he were to obey you (i.e. follow your opinions and desires) in much of the matter, you would surely be in trouble, but Allāh has endeared the Faith to you and has beautified it in your hearts, and has made disbelief, wickedness and disobedience (to Allāh and His Messenger (sallallāhu alaihi wa salam) hateful to you. These! They are the rightly guided ones. (Al-Hujurāt: 7)
Allāh has made these three categories detested to the believers, those with true belief. (This enables them to stay away from perpetrating these sins.)
Firstly, disbelief is hated to them, due to their ēmān being firm and established.
Secondly, wickedness is hated to them, because of this they do not commit major sins, the likes of drinking alcohol, fornication, stealing e.t.c.
Thirdly, disobedience is hated to them, as a result of this they do not oppose the prohibitions (which are established from the sunnah of Allāh’s Messenger (sallallāhu alaihi wa salam)).
When it reaches them that the prophet (sallallāhu alaihi wa salam) forbade something, they stay far away from it and they are not tempted to carry it out ever. This is because they hate it, since Allāh has placed in their hearts dislike for it.
Meaning those who are described with the aforementioned characteristics in the verse. They are the rightly guided ones. And being rightly guided is in opposition to being upon misguidance.
Allāh (Subhānahu wa ta’āla) said,
قَد تَّبَيَّنَ الرُّشْدُ مِنَ الغَيِّ
Verily, the Right Path has become distinct from the wrong path.
and His statement (The Mighty & Majestic),
وَإِن يَرَوْا كُلَّ آيَةٍ لَّا يُؤْمِنُوا بِهَا وَإِن يَرَوْا سَبِيلَ الرُّشْدِ لَا يَتَّخِذُوهُ سَبِيلًا وَإِن يَرَوْا سَبِيلَ الْغَيِّ يَتَّخِذُوهُ سَبِيلًا
And if they see the way of righteousness (monotheism, piety, and good deeds), they will not adopt it as the Way, but if they see the way of error (polytheism, crimes and evil deeds), they will adopt that way (Al-A’rāf: 146)
Then He said,
فَضْلًا مِّنَ اللَّهِ وَنِعْمَةً وَاللَّهُ عَلِيمٌ حَكِيمٌ
(This is) a Grace from Allah and His Favour. And Allah is All-Knowing, All-Wise. (Al-Hujurāt: 8)
This which has transpired for the rightly guided (of guidance and praiseworthy characteristics), has only occurred due to the Favour and Grace of Allāh, not due to their own power or strength. Indeed it is only due to Allāh who has given them success.
This (verse) has within it a reminder that a person shouldn’t be deceived with what he has from religion, knowledge or acts of worship. Instead, he thanks Allah for His blessings upon him (verbally with the tongue and physically with his limbs by using these blessings in the obedience of Allah), and he acknowledges (with his heart) that this is a favour from Allah bestowed upon him.
Allāh is All-Knowing of who is deserving of this grace and blessing.
He is the All-Wise, meaning he places affairs in their appropriate places, therefore he does not bestow this grace and blessing upon those who do not deserve it, verily He only bestows it upon those who are befitting of it.
Shaykh Fawzān’s Mā Tayassar wa Tahassal min Durūs al-Qurān fī Hizb al-Mufassal Vol.1 Pgs. 23-24