Ali bin Abu Talib reported,

The Prophet ﷺ was attending a funeral when he took a stick and began scratching the ground with it. He said, "There is not one of you whose place in the Fire or in the Garden has not already been written."They said, "Messenger of Allah, shall we not then rely upon this and abandon action?"He replied, "Keep working, for everyone is made easy for what he was created. 'As for the one who gives and is mindful of Allah, and affirms the best reward...'" [Layl 92:5–6] and he recited the rest of the verse.Shuba said, Mansur also narrated this to me, and I did not find it inconsistent with the narration of Sulayman.

Bukhari 4946

Sahih

حدثنا بشر بن خالد أخبرنا محمد بن جعفر حدثنا شعبة عن سليمان عن سعد بن عبيدة عن أبي عبد الرحمن السلمي

عن علي رضي الله عنه

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

البخاري 4946صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Tafsir
Chapter
His saying, "We will ease him toward ease"
Numbering
Darussalam 4946
Bukhari 4946