Muslim ibn Yasar al-Juhani said: When Umar ibn al-Khattab was asked about the verse "When your Lord took their offspring from the backs of the children of Adam" - al-Qa'nabi recited the verse--he said: I heard the Messenger of Allah ﷺ say when he was questioned about it: Allah created Adam, then passed His right hand over his back, and brought forth from it his offspring, saying: I have these for Paradise and these will do the deeds of those who go to Paradise. He then passed His hand over his back and brought forth from it his offspring, saying: I have created these for Hell, and they will do the deeds of those who go to Hell. A man asked: What is the good of doing anything, Messenger of Allah? The Messenger of Allah ﷺ said: When Allah creates a servant for Paradise, He employs him in doing the deeds of those who will go to Paradise, so that his final action before death is one of the deeds of those who go to Paradise, for which He will bring him into Paradise. But when He creates a servant for Hell, He employs him in doing the deeds of those who will go to Hell, so that his final action before death is one of the deeds of those who go to Hell, for which He will bring him into Hell. (Using translation from Abū Dāʾūd 4703)
"إِنَّ الله - تَعَالى - خَلَقَ آدَمَ ثُمَّ مَسَحَ ظَهْرَهُ بِيَمِينِهِ فَاستَخْرجَ مِنْهُ ذُرِّيَّةً، فَقَال: خَلَقْتُ هؤُلاءِ لِلجَنَّةِ، وَبَعَمَلِ أهْلِ الْجَنَّةِ يَعْمَلُونَ؛ ثُمَّ مَسَح ظَهْرَهُ، فَاسْتَخْرَجَ مِنْهُ ذُرِّيَّةً فَقَال: خَلَقْتُ هَؤُلاءِ للنَّارِ وَبِعمَلِ أهْلِ النَّارِ يعْمَلُونَ. فَقَال رَجُلٌ: يا رَسُولَ الله فَفِيمَ العَمَلُ؟ قَال: إِنَّ الله - تَعَالى - إِذَا خَلَقَ الْعَبْدَ للجَنَّةِ اسْتَعْملَهُ بِعَمَل أهْلِ الْجَنَّةِ حتَّى يمُوت عَلَى عَمَل مَنْ أعْمَالِ أهْلِ الْجَنَّةِ، فَيُدْخِلَهُ به الْجَنَّةَ؛ وإِذَا خَلَقَ العبْدَ للنَّارِ اسْتعْملَهُ بِعَمَل أهْلِ النَّارِ حتَّى يمُوت عَلَى عَمَل مَنْ أعْمَالِ أهْلِ النَّارِ، فَيُدْخِلَهُ بهِ النَّارَ".