What Benefits the Deceased:
Performing Hajj on behalf of the deceased:
It is narrated from Ibn Abbas (may Allah Almighty be pleased with him) that he said: A man came to the Prophet (may Allah Almighty bless him and give him peace) and said:
“My sister had vowed to perform Hajj, but she died.” The Prophet (may Allah Almighty bless him and give him peace) said:
“If your sister had a debt upon her, would you not pay it off?” He said: “Yes.” The Prophet (may Allah Almighty bless him and give him peace) said:
“Then pay the debt of Allah Almighty, for Allah Almighty has more right that His debt be paid.”
(Bukhari 6699)
Offering sacrifice on behalf of the deceased:
1- When a person offers sacrifice both for the living and the deceased — like a man who sacrifices an animal for himself and his family, intending both the living and those who have passed away — this is permissible. The proof is that the Prophet (may Allah Almighty bless him and give him peace) used to sacrifice on behalf of himself and his family, some of whom had already passed away.
The Prophet (may Allah Almighty bless him and give him peace) used to sacrifice one sheep on behalf of himself and his family.
2- When a person makes a will to have a sacrifice offered after his death, fulfilling his will is necessary unless one lacks financial ability. The proof for this is the verse of the Qur’an:
“So whoever changes the will after hearing it, the sin is only upon those who have changed it. Indeed, Allah Almighty is All-Hearing, All-Knowing.” (Surah Al-Baqarah, verse 181)
3- Performing a separate, independent sacrifice exclusively for the deceased has not been established from the Prophet (may Allah Almighty bless him and give him peace). The Prophet (may Allah Almighty bless him and give him peace) did not offer a sacrifice on behalf of his deceased relatives nor for his uncle Hamzah (may Allah Almighty be pleased with him).
Beneficial knowledge left behind:
“Beneficial knowledge” includes all religious and worldly knowledge that benefits others, but religious knowledge holds the highest priority.
Righteous offspring left behind:
The Messenger of Allah Almighty (may Allah Almighty bless him and give him peace) said: “In Paradise, a man’s rank will be raised, and he will say: ‘How did this happen?’ It will be said to him: ‘Because your child sought forgiveness for you.’”
(Sunan Ibn Majah 3660/1)
Supplication for the deceased:
Regarding supplication and seeking forgiveness, Allah Almighty the Exalted says:
“وَالَّذِينَ جَاؤُوا مِن بَعْدِهِمْ يَقُولُونَ رَبَّنَا اغْفِرْ لَنَا وَلِإِخْوَانِنَا الَّذِينَ سَبَقُونَا بِالْإِيمَانِ وَلَا تَجْعَلْ فِي قُلُوبِنَا غِلًّا لِّلَّذِينَ آمَنُوا رَبَّنَا إِنَّكَ رَءُوفٌ رَّحِيمٌ”
“And those who came after them say, ‘Our Lord, forgive us and our brothers who preceded us in faith, and do not place in our hearts any resentment toward those who have believed. Our Lord, indeed You are Compassionate and Merciful.’” (Surah Al-Hashr, verse 10)
It is narrated from Sayyiduna Uthman ibn Affan (may Allah Almighty be pleased with him) that when the Prophet (may Allah Almighty bless him and give him peace) finished burying a deceased person, he would stand by the grave and say:
“Seek forgiveness for your brother and ask for him to be made steadfast, for now he is being questioned.”
(Abu Dawud 3221)
It is recommended to visit the grave and make supplication for the deceased.
Summary:
From the authentic Islamic texts, it is established that the reward of Hajj performed on behalf of the deceased, the reward of charity given for them, the reward of continuous charity (sadaqah jariyah), and the reward of prayers and supplications offered by the living — all reach and benefit the deceased.