In the Name of Allah, the Gracious, the Merciful
Imam al-Nawawi records in his book Meadows of the Righteous:
باب آداب النَوم والاضْطِجَاع وَالقعُود وما يقوله عند النوم
Chapter on the manners of sleeping, laying, sitting, and what to say at the time of sleeping.
Source: Riyāḍ al-Ṣāliḥīn 1/257
Al-Bara’ ibn ‘Azib reported: The Messenger of Allah, peace and blessings be upon him, said:
إِذَا أَخَذْتَ مَضْجَعَكَ فَتَوَضَّأْ وُضُوءَكَ لِلصَّلاَةِ ثُمَّ اضْطَجِعْ عَلَى شِقِّكَ الأَيْمَنِ ثُمَّ قُلِ اللَّهُمَّ إِنِّي أَسْلَمْتُ وَجْهِي إِلَيْكَ وَفَوَّضْتُ أَمْرِي إِلَيْكَ وَأَلْجَأْتُ ظَهْرِي إِلَيْكَ رَغْبَةً وَرَهْبَةً إِلَيْكَ لاَ مَلْجَأَ وَلاَ مَنْجَا مِنْكَ إِلاَّ إِلَيْكَ آمَنْتُ بِكِتَابِكَ الَّذِي أَنْزَلْتَ وَبِنَبِيِّكَ الَّذِي أَرْسَلْتَ
When you go to sleep, perform ablution as for your prayer, then lie down on your right side and say, ‘O Allah, I submit my face to You, I entrust my affair to You, and I commit myself to You, in hope and in fear of You. There is no refuge or place of safety but with You. I believe in the Book You have revealed, and in the Prophet You have sent.’
Then, the Prophet said:
وَاجْعَلْهُنَّ مِنْ آخِرِ كَلاَمِكَ فَإِنْ مُتَّ مِنْ لَيْلَتِكَ مُتَّ وَأَنْتَ عَلَى الْفِطْرَةِ
Make these your last words. If you died in this night of yours, you will have died upon pure nature.
Source: Ṣaḥīḥ al-Bukhārī 6311, Grade: Muttafaqun Alayhi
Aisha, may Allah be pleased with her, reported:
كَانَ النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ يُصَلِّي مِنَ اللَّيْلِ إِحْدَى عَشْرَةَ رَكْعَةً فَإِذَا طَلَعَ الْفَجْرُ صَلَّى رَكْعَتَيْنِ خَفِيفَتَيْنِ ثُمَّ اضْطَجَعَ عَلَى شِقِّهِ الْأَيْمَنِ حَتَّى يَجِيءَ الْمُؤَذِّنُ فَيُؤْذِنَهُ
The Prophet, peace and blessings be upon him, would pray eleven cycles in the night. When dawn arrived, he would pray two brief cycles, then lie on his right side until the caller came to announce the prayer.
Source: Ṣaḥīḥ al-Bukhārī 6310, Grade: Muttafaqun Alayhi
Abu Dharr reported: When the Prophet, peace and blessings be upon him, would go to sleep at night, he would say:
بِاسْمِكَ نَمُوتُ وَنَحْيَا
In Your name we die and we live.
When the Prophet woke up, he would say:
الْحَمْدُ لِلَّهِ الَّذِي أَحْيَانَا بَعْدَ مَا أَمَاتَنَا وَإِلَيْهِ النُّشُورُ
All praise is due to Allah, who has given us life after our death, and unto Him is the Resurrection.
Source: Ṣaḥīḥ al-Bukhārī 7394, Grade: Sahih
Takhfah ibn Qays reported: While I was lying on my belly in the mosque, the Prophet, peace and blessings be upon him, shook me with his foot, saying:
إِنَّ هَذِهِ ضِجْعَةٌ يُبْغِضُهَا اللَّهُ
Verily, Allah hates this posture.
Source: Sunan Abī Dāwūd 5040, Grade: Sahih
Abu Huraira reported: The Messenger of Allah, peace and blessings be upon him, said:
مَنْ قَعَدَ مَقْعَدًا لَمْ يَذْكُرْ اللَّهَ فِيهِ كَانَتْ عَلَيْهِ مِنْ اللَّهِ تِرَةٌ وَمَنْ اضْطَجَعَ مَضْجَعًا لَا يَذْكُرُ اللَّهَ فِيهِ كَانَتْ عَلَيْهِ مِنْ اللَّهِ تِرَةٌ
Whoever sits in a place and does not remember Allah, he will face a consequence from Allah. Whoever lies down to sleep and does not remember Allah, he will face a consequence from Allah.
Source: Sunan Abī Dāwūd 4856, Grade: Sahih
Abu Huraira reported: The Messenger of Allah, peace and blessings be upon him, said:
مَا مِنْ قَوْمٍ يَقُومُونَ مِنْ مَجْلِسٍ لَا يَذْكُرُونَ اللَّهَ فِيهِ إِلَّا قَامُوا عَنْ مِثْلِ جِيفَةِ حِمَارٍ وَكَانَ لَهُمْ حَسْرَةً
No people stand up from a gathering in which they did not remember Allah but that it is as if they have risen from the carcass of a donkey, and it will cause them grief.
Source: Sunan Abī Dāwūd 4855, Grade: Sahih
Abu Huraira reported: The Messenger of Allah, peace and blessings be upon him, said:
مَا جَلَسَ قَوْمٌ مَجْلِسًا لَمْ يَذْكُرُوا اللَّهَ فِيهِ وَلَمْ يُصَلُّوا عَلَى نَبِيِّهِمْ إِلَّا كَانَ عَلَيْهِمْ تِرَةً فَإِنْ شَاءَ عَذَّبَهُمْ وَإِنْ شَاءَ غَفَرَ لَهُمْ
No people sit in a gathering without remembering Allah, or sending blessings upon their Prophet, but that they will earn the displeasure of Allah. If Allah wills, He will punish them. If He wills, He will forgive them.
Source: Sunan al-Tirmidhī 3380, Grade: Hasan
Abdullah ibn Zayd, may Allah be pleased with him, reported:
أَنَّهُ رَأَى رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ مُسْتَلْقِيًا فِي الْمَسْجِدِ وَاضِعًا إِحْدَى رِجْلَيْهِ عَلَى الْأُخْرَى
He saw the Messenger of Allah, peace and blessings be upon him, lying on his back in the mosque, placing one leg over the other.
Source: Ṣaḥīḥ al-Bukhārī 475, Grade: Muttafaqun Alayhi
Jabir ibn Samurah, may Allah be pleased with him, reported:
كَانَ النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ إِذَا صَلَّى الْفَجْرَ تَرَبَّعَ فِي مَجْلِسِهِ حَتَّى تَطْلُعَ الشَّمْسُ حَسْنَاءَ
The Prophet, peace and blessings be upon him, would pray the dawn prayer and sit crossed legged in his place until the sun had risen brightly.
Source: Sunan Abī Dāwūd 4850, Grade: Sahih
Ibn Umar, may Allah be pleased with him, reported:
رَأَيْتُ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ بِفِنَاءِ الْكَعْبَةِ مُحْتَبِيًا بِيَدِهِ هَكَذَا
I saw the Messenger of Allah, peace and blessings be upon him, sitting by the Ka’bah with his thighs on his stomach and arms around his legs.
Source: Ṣaḥīḥ al-Bukhārī 6272, Grade: Sahih
Qaylah bint Makhramah, may Allah be pleased with her, reported:
رَأَيْتُ النَّبِيَّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ وَهُوَ قَاعِدٌ الْقُرْفُصَاءَ فَلَمَّا رَأَيْتُ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ الْمُخْتَشِعَ فِي الْجِلْسَةِ أُرْعِدْتُ مِنَ الْفَرَقِ
I saw the Prophet, peace and blessings be upon him, sitting with his arms around his legs. When I saw the Messenger of Allah sitting so humbly, I trembled in awe of him.
Source: Sunan Abī Dāwūd 4847, Grade: Hasan
Al-Sharid ibn Suwayd reported: The Messenger of Allah, peace and blessings be upon him, passed by me while I was sitting with my left hand behind my back and leaning upon it. The Prophet said:
أَتَقْعُدُ قِعْدَةَ الْمَغْضُوبِ عَلَيْهِمْ
Do you sit like one with whom Allah is angry?
Source: Sunan Abī Dāwūd 4848, Grade: Sahih
Success comes from Allah, and Allah knows best.