Sahih al-Bukhari, Volume 8, Book 73, Hadith 236 (USC-MSA) ⓘ
Narrated `Ali: We were with the Prophet in a funeral procession, and he started scraping the ground with a small stick and said, "There is none amongst you but has been assigned a place (either) in Paradise and (or) in the Hell-Fire." The people said (to him), "Should we not depend upon it?" He said: carry on doing (good) deeds, for everybody will find easy such deeds as will lead him to his destined place. He then recited: "As for him who gives (in charity) and keeps his duty to Allah.." (92.5)
حَدَّثَنَا مُحَمَّدُ بْنُ بَشَّارٍ، حَدَّثَنَا ابْنُ أَبِي عَدِيٍّ، عَنْ شُعْبَةَ، عَنْ سُلَيْمَانَ، وَمَنْصُورٍ، عَنْ سَعْدِ بْنِ عُبَيْدَةَ، عَنْ أَبِي عَبْدِ الرَّحْمَنِ السُّلَمِيِّ، عَنْ عَلِيٍّ ـ رضى الله عنه ـ قَالَ كُنَّا مَعَ النَّبِيِّ صلى الله عليه وسلم فِي جَنَازَةٍ فَجَعَلَ يَنْكُتُ الأَرْضَ بِعُودٍ، فَقَالَ " لَيْسَ مِنْكُمْ مِنْ أَحَدٍ إِلاَّ وَقَدْ فُرِغَ مِنْ مَقْعَدِهِ مِنَ الْجَنَّةِ وَالنَّارِ ". فَقَالُوا أَفَلاَ نَتَّكِلُ قَالَ " اعْمَلُوا فَكُلٌّ مُيَسَّرٌ ". {فَأَمَّا مَنْ أَعْطَى وَاتَّقَى} الآيَةَ.
also referenced under: Book 78, Hadith 241 (In-Book) & Hadith 6217 (DarusSalam)