We were with the Prophet ﷺ at a funeral when he began poking the ground with a stick. He said, "There is not one of you whose place in Paradise or in the Hellfire has not already been determined."They asked, "Should we not then rely on this and abandon striving?"He replied, "Keep working, for everyone is made easy for what he was created. 'As for he who gives and fears Allah'" [Layl 92:5].
كنا مع النبي ﷺ في جنازة، فجعل ينكت الأرض بعود، فقال: ليس منكم من أحد إلا وقد فرغ من مقعده من الجنة والنار فقالوا: أفلا نتكل؟ قال: اعملوا فكل ميسر {فأما من أعطى واتقى} [الليل: ٥].
Bukhari narrated it in Al-Adab (6217), and Muslim in Al-Qadar (2647:7), both through the route of Saad bin Ubayda, from Abu Abdul-Rahman Sulami, from Ali, who mentioned it. The wording given here is Bukhari's. Both of them narrated it at length, and it has been documented in its proper place.