When a dream frightens you
The Prophet ﷺ taught exactly what to do, and promised it will not harm you.
إِذَا رَأَى أَحَدُكُمُ الرُّؤْيَا يَكْرَهُهَا فَلْيَبْصُقْ عَنْ يَسَارِهِ ثَلاَثًا وَلْيَسْتَعِذْ بِاللَّهِ مِنَ الشَّيْطَانِ ثَلاَثًا وَلْيَتَحَوَّلْ عَنْ جَنْبِهِ الَّذِي كَانَ عَلَيْهِ
If one of you sees a dream he dislikes, let him spit lightly to his left three times, seek refuge in Allah from Satan three times, and turn over onto his other side.
The Prophet ﷺ also said not to tell anyone about it, and that it will not harm you.
The full narration
Jabir reported Allah's Messenger (ﷺ) as saying:If anyone sees a dream which he does not like, he should spit on his left side three times, and seek refuge with Allah from the Satan three times, and let him turn over from the side on which he was sleeping
Source
Ṣaḥīḥ Muslim · 5904
- Agreed upon as authentic (al-Bukhārī / Muslim)