Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:47:3

That is because those who disbelieve follow falsehood, and those who believe follow the truth from their Lord. Thus does Allah present to the people their comparisons.  

That, rendering void of their works and the absolution of evil deeds, is because those who disbelieve follow falsehood, Satan, and because those who believe follow the truth, the Qur’ān, from their Lord. Thus, in the same manner of clarification, does God strike for mankind similitudes of themselves, ˹that is how˺ He clarifies for them their states, in other words, the disbeliever has his work rendered void while the believer is forgiven.
القرآن:٤٧:٣

ذَٰلِكَ بِأَنَّ الَّذِينَ كَفَرُوا اتَّبَعُوا الْبَاطِلَ وَأَنَّ الَّذِينَ آمَنُوا اتَّبَعُوا الْحَقَّ مِنْ رَبِّهِمْ ۚ كَذَٰلِكَ يَضْرِبُ اللَّهُ لِلنَّاسِ أَمْثَالَهُمْ  

{ذلك} أي إضلال الأعمال وتكفير السيئات {بأن} بسبب أن {الذين كفروا اتبعوا الباطل} الشيطان {وأن الذين آمنوا اتبعوا الحق} القرآن {من ربهم كذلك} أي مثل ذلك البيان {يضرب الله للناس أمثالهم} يبيِّن أحوالهم، أي فالكافر يحبط عمله، والمؤمن يغفر له.