Mishkat al-Masabih 85
عَن عَليّ رَضِي الله عَنهُ قَالَ كُنَّا فِي جَنَازَة فِي بَقِيع الْغَرْقَد فَأَتَانَا النَّبِي صلى الله عَلَيْهِ وَسلم فَقعدَ وقعدنا حوله وَمَعَهُ مخصرة فَنَكس فَجعل ينكت بمخصرته ثمَّ قَالَ مَا مِنْكُم من أحد مَا من نفس منفوسة إِلَّا كتب مَكَانهَا من الْجنَّة وَالنَّار وَإِلَّا قد كتب شقية أَو سعيدة فَقَالَ رجل يَا رَسُولَ اللَّهِ أَفَلَا نَتَّكِلُ عَلَى كِتَابِنَا وَنَدع الْعَمَل فَمن كَانَ منا من أهل السَّعَادَة فسيصير إِلَى عمل أهل السَّعَادَة وَأما من كَانَ منا من أهل الشقاوة فسيصير إِلَى عمل أهل الشقاوة قَالَ أما أهل السَّعَادَة فييسرون لعمل السَّعَادَة وَأما أهل الشقاوة فييسرون لِعَمَلِ الشَّقَاوَةِ ثُمَّ قَرَأَ (فَأَمَّا مَنْ أَعْطَى وَاتَّقَى وَصدق بِالْحُسْنَى) الْآيَة
From ʿAli, may Allah be pleased with him, who said: We were at a funeral in Baqiʿ al-Gharqad. The Prophet ﷺ came to us and sat down, and we sat around him. He had a stick with him; he lowered his head and began scratching [the ground] with his stick. Then he said: "There is none of you, there is no living soul, except that its place in Paradise or the Fire has been written, and it has been written whether it is wretched or happy." A man said: "O Messenger of Allah, shall we not then rely on what is written for us and leave off deeds? Whoever of us is of the people of happiness will come to the deeds of the people of happiness, and whoever of us is of the people of wretchedness will come to the deeds of the people of wretchedness." He said: "As for the people of happiness, they are eased to the deeds of happiness; and as for the people of wretchedness, they are eased to the deeds of wretchedness." Then he recited: 'As for him who gives and fears [Allah] and affirms the best' (the verse).