From Nathan Bransford:
Writers are often tempted to pen dream sequences and hallucinations. And for good reason! Reading a novel itself feels a bit like a dream, and writers want to take full advantage of the medium, which allows us to get inside a character’s head in an unparalleled way.
But you should proceed with the utmost caution.
Once you start undermining the reality of a novel it becomes difficult for the reader to assume anything is real. After a dream sequence, from that point on the reader is going to have in the back of their mind: “Is this a dream? Is the character hallucinating?”
. . . .
To be totally honest with you, most dream sequences and hallucinations tend to feel pretty self-indulgent. They are often writing for writing’s sake and authors often use them as a chance to flex their writing muscles.
They almost always fall into an awkward nether region akin to the problem with including intentional symbolism. If it’s super obvious what we’re supposed to take away from a dream sequence the reader might feel a bit beaten over the head, and if it’s not obvious what we’re supposed to take away… well, we’re not really taking anything away.
. . . .
Unless you’re writing something along the lines of magical realism, where the boundaries between waking and dream life are intentionally blurry, in order to avoid disorienting the reader you should try to keep the dream/hallucination tightly bound and contained.
Basically: It’s clear the reader was asleep/out of it, now it’s clear they’re awake/lucid.
This means avoiding “rug pulling” techniques where the dream exists solely to trick the reader. These tend to be pretty cheap plot devices on TV shows, but they’re even worse in novels because of how much harder it is for a reader to suspend disbelief and get into a flow losing themselves in the world of the novel.
Link to the rest at Nathan Bransford