«إِذَا مَاتَ الْإِنْسَانُ انْقَطَعَ عَمَلُهُ إِلَّا مِنْ ثَلَاثٍ: مِنْ وَلَدٍ صَالِحٍ يَدْعُو لَهُ، أَوْ صَدَقَةٍ جَارِيَةٍ مِنْ بَعْدِهِ، أَوْ عِلْمٍ يُنْتَفَعُ بِه»
(When a person dies, his deeds will cease except in three cases: from a righteous son who invokes Allah for him, or an ongoing charity after his death, or knowledge that people benefit from.) These three things are, in reality, a result of one's own deeds, efforts and actions. For example, a Hadith states,