Ali bin Abu Talib reported,

We were at a funeral in Baqi al-Gharqad when the Messenger of Allah ﷺ came to us. He sat down and we sat around him. He had a small staff with him. He lowered his head and began scratching at the ground with his staff, then said, "There is not one of you, not a single soul that has been born, except that Allah has already written its place in Paradise or in the Fire, and whether it will be wretched or blessed."A man said, "Messenger of Allah, should we then not just 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, "Work, for everyone is made easy toward that for which he was created. As for the people of blessedness, they are made easy for the deeds of the people of blessedness, and as for the people of wretchedness, they are made easy for the deeds of the people of wretchedness."Then he recited, "As for the one who gives and is mindful of Allah, and believes in the best reward, We will ease him toward ease. But as for the one who is stingy and considers himself self-sufficient, and denies the best reward, We will ease him toward hardship" [Layl 92:5–10].

Muslim 6731

Sahih

حدثنا عثمان بن أبي شيبة وزهير بن حرب وإسحق بن إبراهيم واللفظ لزهير قال إسحق أخبرنا و قال الآخران حدثنا جرير عن منصور عن سعد بن عبيدة عن أبي عبد الرحمن

عن علي قال

كنا في جنازة في بقيع الغرقد فأتانا رسول الله ﷺ فقعد وقعدنا حوله ومعه مخصرة فنكس فجعل ينكت بمخصرته ثم قال ما منكم من أحد ما من نفس منفوسة إلا وقد كتب الله مكانها من الجنة والنار وإلا وقد كتبت شقية أو سعيدة قال فقال رجل يا رسول الله أفلا نمكث على كتابنا وندع العمل فقال من كان من أهل السعادة فسيصير إلى عمل أهل السعادة ومن كان من أهل الشقاوة فسيصير إلى عمل أهل الشقاوة فقال اعملوا فكل ميسر أما أهل السعادة فييسرون لعمل أهل السعادة وأما أهل الشقاوة فييسرون لعمل أهل الشقاوة ثم قرأ {فأما من أعطى واتقى وصدق بالحسنى فسنيسره لليسرى وأما من بخل واستغنى وكذب بالحسنى فسنيسره للعسرى}

مسلم 6731صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Decree
Chapter
How the human is created in his mother's womb and the recording of his provision, lifespan, deeds, misery, and happiness
Numbering
Darussalam 6731
Muslim 6731