Al-Adab Al-Mufrad, Book 9, Hadith 156 (English)

'Ali ibn Talib reported that when the illness of the Prophet, may Allah bless him and grant him peace, deepened, he said, "'Ali! Bring me a page on which I can write something for my community after which they will not go astray." 'Ali said, "I feared that he would die before I could do that, so I said, 'I will remember better than the paper.' His head was between my forearm and my leg. He recommended the prayer, zakat and kind treatment of slaves. he spoke like that until he died." He commanded him to testify, "There is no god but Allah and Muhammad is His slave and Messenger. Anyone who testifies to that is saved from the Fire."

حَدَّثَنَا حَفْصُ بْنُ عُمَرَ، قَالَ‏:‏ حَدَّثَنَا عُمَرُ بْنُ الْفَضْلِ، قَالَ‏:‏ حَدَّثَنَا نُعَيْمُ بْنُ يَزِيدَ، قَالَ‏:‏ حَدَّثَنَا عَلِيُّ بْنُ أَبِي طَالِبٍ صَلَوَاتُ اللهِ عَلَيْهِ، أَنَّ النَّبِيَّ صلى الله عليه وسلم لَمَّا ثَقُلَ قَالَ‏:‏ يَا عَلِيُّ، ائْتِنِي بِطَبَقٍ أَكْتُبْ فِيهِ مَا لاَ تَضِلُّ أُمَّتِي بَعْدِي، فَخَشِيتُ أَنْ يَسْبِقَنِي فَقُلْتُ‏:‏ إِنِّي لَأَحْفَظُ مِنْ ذِرَاعَيِ الصَّحِيفَةِ، وَكَانَ رَأْسُهُ بَيْنَ ذِرَاعِي وَعَضُدِي، فَجَعَلَ يُوصِي بِالصَّلاَةِ وَالزَّكَاةِ وَمَا مَلَكَتْ أَيْمَانُكُمْ، وَقَالَ كَذَاكَ حَتَّى فَاضَتْ نَفْسُهُ، وَأَمَرَهُ بِشَهَادَةِ أَنْ لاَ إِلَهَ إِلاَّ اللَّهُ وَأَنَّ مُحَمَّدًا عَبْدُهُ وَرَسُولُهُ، مَنْ شَهِدَ بِهِمَا حُرِّمَ عَلَى النَّارِ‏.‏

sunnah.com