DUAS BEFORE SLEEPING

If one of you rises from his bed and then returns to it he should dust it with the edge of his garment three times for he does not know what has occurred in his absence and when he lies down he should supplicate:

بِاسْمِكَ رَبِّي وَضَعْتُ جَنْبِي، وَبِكَ أَرْفَعُهُ، فَإِنْ أَمْسَكْتَ نَفْسِي فَارْحَمْهَا، وَإِنْ أَرْسَلْتَهَا فَاحْفَظْهَا، بِمَا تَحْفَظُ بِهِ عِبَادَكَ الصَّالِحِينَ

“Bismika Rabbee wadha’tu janbee, wa bika ‘arfa’uhu, fa’in ‘amsakta nafsee farhamhaa, wa ‘in ‘arsaltahaa fahfadhhaa, bimaa tahfadhu bihi ‘ibaadakas-saaliheen.”

“In Your name my Lord, I lie down and in Your name I rise, so if You should take my soul then have mercy upon it, and if You should return my soul then protect it in the manner You do so with Your righteous servants.”
[Bukhari and Muslim]

The Prophet (ﷺ) would place his right hand under his cheek when about to sleep and supplicate:
اللَّهُمَّ قِنِي عَذَابَكَ يَوْمَ تَبْعَثُ عِبَادَكَ

Allaahumma qinee ‘athaabaka yawma tab’athu ‘ibaadaka. (3 times)

“O Allah, protect me from Your punishment on the day Your servants are resurrected.”
[Abu Dawud]

Also read this dua:
بِاسْمِكَ اللَّهُمَّ أَمُوتُ وَأَحْيَا

Bismikallahumma amootu wa-ahya

“In Your name O Allah, I live and die”
[Muslim]

At the time of difficulty when sleeping, Zaid bin Thaabit (RA) complained to Rasulallah (ﷺ) of not being able to go to sleep at times and he advised him to recite the following dua:

اللَّهُمَّ غَارَتِ النُّجُومُ وَهَدَأَتِ الْعُيُونُ وَأَنْتَ حَيٌّ قَيُّومٌ * لَا تَأْخُذُكَ سِنَةٌ وَلَا نَوْمٌ يَا حَيُّ يَا قَيُّومُ أَهْدِئْ لَيْلِي وَأَنِمْ عَيْنِي

Allahummah ghaarithinnujumu wa hadaathil uyoonu wa antha hayyun qayyumulla tha’ khudhu ka sinathuwalaa nawmun yaa hayyun yaa qayyoomu a’hde’ laylee wa anim ‘aynee.

“Oh Allah the stars have sunk in and the eyes have become tranquil and quite and You are alive and ever lasting neither does sleep overcome You. Oh the living and ever lasting one make my night my tranquil and give my eyes sleep.”
[Ibn Sunni, Hisnul Hasin]

If afraid to go to sleep or feeling lonely or depressed then recite:

أَعُوذُ بِكَلِمَاتِ اللهِ التَّامَّاتِ مِنْ غَضَبِهِ وَعِقَابِهِ، وَشَرِّ عِبَادِهِ، وَمِنْ هَمَزَاتِ الشَّيَاطِينِ وَأَنْ يَحْضُرُونِ

A’oothu bikalimaatil-laahit-taammaati min ghadhabihi wa ‘iqaabihi, wa sharri ‘ibaadihi, wa min hamazaatish-shayaateeni wa ‘an yahdhuroon.

“I seek refuge in the Perfect Words of Allah from His anger and His punishment, from the evil of His slaves and from the taunts of devils and from their presence.”
[Abu Dawud and Tirmithi]

This is to be recited if you turn over in bed during the night:

لَا إِلَهَ إِلَّا اللهُ الْوَاحِدُ اْقَهَّارُ، رَبُّ السَّمَاوَاتِ وَالْأَرْضِ وَمَا بَيْنَهُمَا الْعَزِيزُ الْغَفَّارُ

Laa ‘ilaaha ‘illallaahul-Waahidul-Qahhaaru, Rabbus-samaawaati wal’ardhi wa maa baynahumal-‘Azeezul-Ghaffaaru.

“There is none worthy of worship but Allah, the One, the Victorious, Lord of the heavens and the earth and all that is between them, the All-Mighty, the All-Forgiving.”
[An-Nasa’i, ‘Amalul-Yawm wal-Laylah, and Ibn As-Sunni]

If after sleeping one experience a pleasant dream then when ones eyes open then say:
Alhamdulillah
(All Praise be to Allah)

Then the pleasant dream should only be revealed to trustworthy learned ones so that the dream can be interpreted correctly.

If one experiences an unpleasant dream then one should spittle (a form of spitting comprising mainly of air with little spit) three times on the left side and then recite three times:
Audhobillaahi Minashaythaanirajeem.
(I seek refuge with Allah from the evil of shaythan.)

Also change one’s position to the other side and sleep.
[Muslim]

The dream should not be revealed to anyone then it will bring no harm to the person.
[Bukhari, Muslim]

REMEMBRANCE OF ALLAH (DHIKR) BEFORE FALLING ASLEEP

The remembrance of Allah just when one is about to sleep shall be a means of that person achieving high stages in Jannah. (Attargheeb)

Isthaghfaar (3 times):

Asthaghfirullah halladhee laa ilaaha ilallahuwal hayyul qayyumu wa athubu ilay.

“I seek forgiveness from Allah besides whom there is none worthy of worship, the living, the sustainer of life and to Him I repent.”
[Tirmidhi]

Before you go to bed perform Wudhu as you would for prayer, then lie down on your right side and recite:

اللَّهُمَّ أَسْلَمْتُ نَفْسِي إِلَيْكَ، وَفَوَّضْتُ أَمْرِي إِلَيْكَ، وَوَجَّهْتُ وَجْهِي إِلَيْكَ، وَأَلْجَأْتُ ظَهْرِي إِلَيْكَ، رَغْبَةً وَرَهْبَةً إِلَيْكَ، لَا مَلْجَأَ وَلّا مَنْجَا مِنْكَ إِلَّا إِلَيْكَ، آمَنْتُ بِكِتَابِكَ وَبِنَبِيِّكَ الَّذِي أَرْسَلْتَ

Allahumma aslamtu nafsee ilayk, wafawwadtu amree ilayk, wawajjahtu wajhee ilayk, wa-alja’tu thahree ilayk, raghbatan warahbatan ilayk, la maljaa wala manja minka illa ilayk, amantu bikitabikal-lathee anzalt, wabinabiyyikal-lathee arsalt.

“O Allah, I submit my soul unto You, and I entrust my affair unto You, and I turn my face towards You, and I totally rely on You, in hope and fear of You. Verily there is neither refuge nor safe haven from You except with You. I believe in Your Book which You have revealed and in Your Prophet whom You have sent.

The Prophet (ﷺ) said:

“Whoever says this and dies in his sleep has died in a state of the natural monotheism (Fitrah).”

[Bukhari and Muslim]