A disturbing dream is from Shayṭān — do four things. The Prophet ﷺ taught: spit dryly to your left three times, seek refuge in Allah from its evil and from Shayṭān, turn onto your other side, and tell no one about it — then it will not harm you. (al-Bukhārī & Muslim). A good dream is from Allah, so praise Him for it.

العربية: عن أبي قتادة رضي الله عنه أنّ النبيّ ﷺ قال: «الرؤيا الصالحة من الله، والحُلُم من الشيطان، فإذا حلم أحدكم حُلمًا يكرهه فليتفل عن يساره ثلاثًا، وليتعوّذ بالله من شرّها، فإنها لن تضرّه». (البخاري ومسلم).

After a nightmare: spit dry left three times, say ‘Aʿūdhu billāh,’ change sides, and tell no one.