Language:
كتاب الجنائز
23  
Funerals (Al-Janaa'iz)
(28)
Chapter: (if) somebody prepared his shroud (before his death)
(28)
باب مَنِ اسْتَعَدَّ الْكَفَنَ فِي زَمَنِ النَّبِيِّ صلى الله عليه وسلم فَلَمْ يُنْكَرْ عَلَيْهِ
Sahih al-Bukhari 1277

Narrated Sahl:

A woman brought a woven Burda (sheet) having edging (border) to the Prophet, Then Sahl asked them whether they knew what is Burda, they said that Burda is a cloak and Sahl confirmed their reply. Then the woman said, "I have woven it with my own hands and I have brought it so that you may wear it." The Prophet (ﷺ) accepted it, and at that time he was in need of it. So he came out wearing it as his waist-sheet. A man praised it and said, "Will you give it to me? How nice it is!" The other people said, "You have not done the right thing as the Prophet (ﷺ) is in need of it and you have asked for it when you know that he never turns down anybody's request." The man replied, "By Allah, I have not asked for it to wear it but to make it my shroud." Later it was his shroud.

حَدَّثَنَا عَبْدُ اللَّهِ بْنُ مَسْلَمَةَ، حَدَّثَنَا ابْنُ أَبِي حَازِمٍ، عَنْ أَبِيهِ، عَنْ سَهْلٍ ـ رضى الله عنه ـ أَنَّ امْرَأَةً، جَاءَتِ النَّبِيَّ صلى الله عليه وسلم بِبُرْدَةٍ مَنْسُوجَةٍ فِيهَا حَاشِيَتُهَا ـ أَتَدْرُونَ مَا الْبُرْدَةُ قَالُوا الشَّمْلَةُ‏.‏ قَالَ نَعَمْ‏.‏ قَالَتْ نَسَجْتُهَا بِيَدِي، فَجِئْتُ لأَكْسُوَكَهَا‏.‏ فَأَخَذَهَا النَّبِيُّ صلى الله عليه وسلم مُحْتَاجًا إِلَيْهَا، فَخَرَجَ إِلَيْنَا وَإِنَّهَا إِزَارُهُ، فَحَسَّنَهَا فُلاَنٌ فَقَالَ اكْسُنِيهَا، مَا أَحْسَنَهَا‏.‏ قَالَ الْقَوْمُ مَا أَحْسَنْتَ، لَبِسَهَا النَّبِيُّ صلى الله عليه وسلم مُحْتَاجًا إِلَيْهَا، ثُمَّ سَأَلْتَهُ وَعَلِمْتَ أَنَّهُ لاَ يَرُدُّ‏.‏ قَالَ إِنِّي وَاللَّهِ مَا سَأَلْتُهُ لأَلْبَسَهَا إِنَّمَا سَأَلْتُهُ لِتَكُونَ كَفَنِي‏.‏ قَالَ سَهْلٌ فَكَانَتْ كَفَنَهُ‏.‏
Reference : Sahih al-Bukhari 1277
In-book reference : Book 23, Hadith 38
USC-MSA web (English) reference : Vol. 2, Book 23, Hadith 367
  (deprecated numbering scheme)