At the time of difficulty when Sleeping
To be recited when having difficulty obtaining sleep
اللَّهُمَّ غَارَتِ النُّجُومُ وَهَدَأَتِ الْعُيُونُ وَأَنْتَ حَيٌّ قَيُّومٌ * لَا تَأْخُذُكَ سِنَةٌ وَلَا نَوْمٌ يَا حَيُّ يَا قَيُّومُ أَهْدِئْ لَيْلِي وَأَنِمْ عَيْنِي
"O Allah the stars have gone far away and the eyes are rested. You are Alive and Infinite, You do not slumber nor does sleep overtake You. Oh Alive and the Everlasting One, grant me rest tonight and let my eyes sleep (close).
(Hisnul Hasin)
After having a nightmare
Upon having a nightmare, recite
:
أَعُوذُ بِكَلِمَاتِ اللَّهِ التَّامَّةِ مِنْ غَضَبِهِ وَعِقَابِهِ وَشَرِّ عِبَادِهِ وَمِنْ هَمَزَاتِ الشَّيَاطِينِ وَأَنْ يَحْضُرُونَ
With the total words of Allah, I seek protection from His wrath, from His punishment and from the servants evil and from the whispers of Satan and I seek protection from (these) coming to me.
(Hisnul Hasin)
On having a good dream, recite: "Alhamdulillah" and relate it to an intimate companion of understanding (So that the companion does not interpret the dream badly). If a person has a bad dream, then spit three times over the left shoulder and turn to the other side or stand up to perform Salaat reciting the following dua three times
:
أَعُوذُ بِاللَّهِ مِنَ الشَّيْطَانِ الرَّجِيمِ
وَمِنْ شَرِّ هَذِهِ الرُّؤْيَا
"I seek refuge in Allah from the accursed Satan and from the evil of this dream. "The dream will not cause any harm. (Misjkat, Hisnul Hasin)
It is a great sin to conjure a false dream and narrate it.
(Bukhari