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:5:27

And recite to them the story of Adam's two sons, in truth, when they both offered a sacrifice ˹to Allah˺, and it was accepted from one of them but was not accepted from the other. Said ˹the latter˺, "I will surely kill you." Said ˹the former˺, "Indeed, Allah only accepts from the righteous ˹who fear Him˺.  

And recite, O Muhammad (s), to them, your people, the story, the tale, of the two sons of Adam, Abel and Cain, truthfully (bi’l-haqq is semantically connected to utlu, ‘recite’), how they each offered a sacrifice, to God, which in Abel’s case was a ram, and in Cain’s, some green crops, and it was accepted from one of them, namely, from Abel, when a fire came down from the heaven and consumed his offering, and not accepted from the other, that is, from Cain, and so he became furious and kept secret his envy until Adam left on pilgrimage. He said, to him, ‘I will surely slay you,’, and the other said, ‘Why?’, to which the first replied, ‘Because only your offering was accepted’. The other said, ‘God accepts only from the God-fearing’.
القرآن:٥:٢٧

وَاتْلُ عَلَيْهِمْ نَبَأَ ابْنَيْ آدَمَ بِالْحَقِّ إِذْ قَرَّبَا قُرْبَانًا فَتُقُبِّلَ مِنْ أَحَدِهِمَا وَلَمْ يُتَقَبَّلْ مِنَ الْآخَرِ قَالَ لَأَقْتُلَنَّكَ ۖ قَالَ إِنَّمَا يَتَقَبَّلُ اللَّهُ مِنَ الْمُتَّقِينَ  

{واتل} يا محمد {عليهم} على قومك {نبأ} خبر {ابنيْ آدم} هابيل وقابيل {بالحق} متعلق بأُتل {إذ قرَّبا قربانا} إلى الله وهو كبش لهابيل وزرع لقابيل {فتُقبل من أحدهما} وهو هابيل بأن نزلت نار من السماء فأكلت قربانه {ولم يُتقبل من الآخر} وهو قابيل فغضب وأضمر الحسد في نفسه إلى أن حج آدم {قال} له {لأقتلنك} قال: لَم قال لتقبل قربانك دوني {قال إنما يتقبل الله من المتقين}.