have a nightmare
魘 centers on a terrifying dream experience: having a nightmare, where sleep is disturbed by oppressive, frightening visions.
魘 combines 厭 (oppression, pressure) with 鬼 (ghost, demon), suggesting a nightmare as a demonic oppression during sleep. The exact historical development is uncertain, but the component structure is consistent with a phono-semantic compound where 厭 contributes both sound and meaning.
Outside is 厭, which suggests something pressing down or oppressive. Inside is 鬼, a ghost or demon. Picture a demon pressing on your chest while you sleep, causing a nightmare.
For エン, imagine the nightmare ending when you wake up: end -> エン. The oppressive demon vanishes as the dream ends.