Ali bin Abu Talib reported,

We were at a funeral in Baqee al-Gharqad when the Prophet ﷺ came to us and sat down, and we sat around him. He had a small stick with him, and he lowered his head and began scratching the ground with it. Then he said, "There is not one of you, not a single soul that has been born, whose place in Paradise or Hell has not already been written, and whose wretchedness or happiness has not already been decreed."A man asked, "Messenger of Allah, should we then not rely on what has been written for us and abandon deeds? For whoever among us is of the people of happiness will arrive at the deeds of the people of happiness, and whoever among us is of the people of wretchedness will arrive at the deeds of the people of wretchedness."He replied, "As for the people of happiness, they will be made to find ease in the deeds of happiness, and as for the people of wretchedness, they will be made to find ease in the deeds of wretchedness."Then he recited, "As for the one who gives and is mindful of Allah" [Layl 92:5], the verse.

Azami 1013

Sahih

عن علي بن أبي طالب قال

كنا في جنازة في بقيع الغرقد، فأتانا النبي ﷺ فقعد، وقعدنا حوله ومعه مخصرة فنكس فجعل ينكت بمخصرته، ثم قال: ما منكم من أحد ما من نفس منفوسة إلا كتب مكانها من الجنة والنار، وإلا قد كتبت شقية أو سعيدة. فقال رجل: يا رسول الله أفلا نتكل على كتابنا وندع العمل، فمن كان منا من أهل السعادة فسيصير إلى عمل أهل السعادة، وأما من كان منا من أهل الشقاوة فسيصير إلى عمل أهل الشقاوة؟ قال: أما أهل السعادة فييسرون لعمل السعادة، وأما أهل الشقاوة فييسرون لعمل الشقاوة. ثم قرأ: {فأما من أعطى واتقى} الآية [سورة الليل: ٥].

الأعظمي 1013صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Faith
Chapter
Belief in the divine decree and predestination
Section
What has already been decreed, and everyone is facilitated for what they were created for
Numbering
Jami al-Kamil 1013 (2nd edition)
Azami 1013