“No person earns any (sin) except against himself (only) and no bearer of burdens shall bear the burden of another”. (Quran 6:164).
Tafsir ibn Kahteer: Thus emphasizing Allah`s reckoning, decision and justice that will occur on the Day of Resurrection. The souls will only be recompensed for their deeds, good for good and evil for evil. No person shall carry the burden of another person, a fact that indicates Allah`s perfect justice.
In another ayat Allah says:
“And if one heavily laden calls another to bear his load, nothing of it will be lifted even though he be near of kin”.
But one the other hand:
“Every person is a pledge for what he has earned. Except those on the right”. (Quran 74:38-39).
Tafsir ibn Katheer: every person will be tied up to his evil deeds. But, for those on the right – the believers – the blessing of their good works will benefit their offsprings and relatives, as well. Allah said in Surah At-Tur:
“And those who believe and whose offspring follow them in faith, to them shall We join their offspring, and We shall not decrease the reward of their deeds in anything”. (Quran 52:21).
Tafsir ibn Katheer: We shall elevate their offspring to their high grades in Paradise, even though the deeds of the offspring were less righteous, since they shared faith with them in its general form. Allah says we did not decrease the grades of those (their offspring and relatives) who have lesser grades, can share the same grades as them. Rather Allah elevates the lesser believers to the grades of their parents by the blessing of their parents good works, by His favour and bounty.
Source: Tafsir ibn kahteer.