We were at a funeral in the cemetery of Gharqad when the Messenger of Allah ﷺ came to us and sat down, and we sat around him. He had a small stick with him. He lowered his head and began poking at the ground with the stick. Then he said, "There is not one of you, there is no soul brought into being, but that Allah has already written its place in Paradise or in the Fire, and it has already been written down as wretched or as blessed."A man said, "Messenger of Allah, then should we not simply rely on what has been written for us and abandon action?"He replied, "Whoever is among the people of blessedness will come to do the deeds of the people of blessedness, and whoever is among the people of wretchedness will come to do the deeds of the people of wretchedness." Then he said, "Act, for everyone is made ready for his path. As for the people of blessedness, they are made ready for the deeds of the people of blessedness, and as for the people of wretchedness, they are made ready for the deeds of the people of wretchedness."Then he recited, "As for the one who gives and is mindful of Allah and affirms the truth of what is best, We shall ease his way to what is easy. But as for the one who is miserly and self-satisfied and denies the truth of what is best, We shall ease his way to hardship" [Layl 92:5–10].
كنا في جنازة في بقيع الغرقد، فأتانا رسول الله ﷺ فقعد، وقعدنا حوله، ومعه مخصرة، فنكس فجعل ينكت بمخصرته، ثم قال: ما منكم من أحد، ما من نفس منفوسة إلا وقد كتب الله مكانها من الجنة والنار، وإلا وقد كتبت شقية أو سعيدة. قال: فقال رجل: يا رسول الله، أفلا نمكث على كتابنا، وندع العمل؟ فقال: من كان من أهل السعادة فسيصير إلى عمل أهل السعادة، ومن كان من أهل الشقاوة فسيصير إلى عمل أهل الشقاوة فقال: اعملوا فكل ميسر، أما أهل السعادة فييسرون لعمل أهل السعادة، وأما أهل الشقاوة فييسرون لعمل أهل الشقاوة. ثم قرأ: {فأما من أعطى واتقى وصدق بالحسنى فسنيسره لليسرى وأما من بخل واستغني وكذب بالحسنى فسنيسره للعسرى}.
Bukhari related it in the Book of Tafsir (4978), and Muslim in the Book of Qadr (2647), both from Uthman bin Abu Shayba, who said, Jareer narrated to us, from Mansur, from Saad bin Ubayda, from Abu Abdul-Rahman Sulami, from Ali, who said, and then he mentioned it, and the wording given here is Muslim's. There are other hadiths on this subject, which are mentioned in the Book of Faith.