Surah At-Tur

52:21

وَٱلَّذِينَ ءَامَنُوا۟ وَٱتَّبَعَتْهُمْ ذُرِّيَّتُهُم بِإِيمَٰنٍ أَلْحَقْنَا بِهِمْ ذُرِّيَّتَهُمْ وَمَآ أَلَتْنَٰهُم مِّنْ عَمَلِهِم مِّن شَىْءٍۢ ۚ كُلُّ ٱمْرِئٍۭ بِمَا كَسَبَ رَهِينٌۭ

And those who believed and whose descendants followed them in faith - We will join with them their descendants, and We will not deprive them of anything of their deeds. Every person, for what he earned, is retained.

Tafsir 52:21

And those who brought faith and whose children followed them in faith - I will join their children with them so that they are pleased with them, even though they did not reach their actions. And I will not decrease anything from the reward of their actions. Every person will be held for the bad actions he earned; nobody else will bear any of his actions.