Prophetic Supplication for Restlessness, Fear & Nightmares
Explicitly established in Quran or Sahih Hadith as ruqyah/protection for this exact matter.
The Messenger of Allah (ﷺ) taught them to say when feeling fear in sleep: 'I seek refuge in the perfect words of Allah from His anger, His punishment, the evil of His servants, and from the whisperings of devils and from their presence.'
Allah - there is no deity except Him, the Ever-Living, the Sustainer of [all] existence. Neither drowsiness overtakes Him nor sleep. To Him belongs whatever is in the heavens and whatever is on the earth. Who is it that can intercede with Him except by His permission? He knows what is [presently] before them and what will be after them, and they encompass not a thing of His knowledge except for what He wills. His Kursi extends over the heavens and the earth, and their preservation tires Him not. And He is the Most High, the Most Great.
Whenever the Messenger of Allah ﷺ went to bed each night, he would cup his palms together, blow lightly into them, and recite Surah Al-Ikhlas, Surah Al-Falaq, and Surah An-Nas into them, then wipe over whatever he could of his body with them.
How to Perform / When to Recite
Perform wudu before sleeping and dust the bed. Recite Ayat al-Kursi and the Three Quls (Ikhlas, Falaq, Nas), blowing into cupped hands and wiping the body. If waking with fright or restlessness, recite: 'A'oodhu bi-kalimatil-lahit-tammati min ghadabihi wa 'iqabihi wa sharri 'ibadihi...'
Important Safety Note: Ruqyah is a means of seeking Allah's protection and healing; it does not replace medical care. Never hang amulets or go to fortune-tellers/sorcerers.