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:35:22

And not equal are the living and the dead. Indeed, Allah causes to hear whom He wills, but you cannot make hear those in the graves.  

nor are the living equal to the dead, the believers and the disbelievers ˹respectively˺ (the addition of the particle lā, ‘nor’, in all three instances is for emphasis). Indeed God makes to hear whomever He will, to be guided, so that such ˹a person˺ then responds to Him by embracing faith. But you cannot make those who are in the graves to hear, namely, the disbelievers — whom He has likened to the dead — ˹to hear˺ and so respond.
القرآن:٣٥:٢٢

وَمَا يَسْتَوِي الْأَحْيَاءُ وَلَا الْأَمْوَاتُ ۚ إِنَّ اللَّهَ يُسْمِعُ مَنْ يَشَاءُ ۖ وَمَا أَنْتَ بِمُسْمِعٍ مَنْ فِي الْقُبُورِ  

{وما يستوي الأحياء ولا الأموات} المؤمنون ولا الكفار، وزيادة لا في الثلاثة تأكيد {إن الله يسمع من يشاء} هدايته فيجيبه بالإيمان {وما أنت بمسمع من في القبور} أي الكفار شبههم بالموتى فيجيبون.