What is the best way to handle flashbacks or dream sequences in a screenplay?

If you want the viewer (and therefore the reader) to know that a scene is or is part of a flashback or dream sequence, add the tag in brackets after the header.

INT. TOM’S BEDROOM – DAY [FLASHBACK]

If you don’t want the viewer to be immediately aware, omit the tag.

This advice also applies to any other alternate world that could crop up in a screenplay. If your story is about a writer and we occasionally enter the world of the novel she is writing, append those scene headers with [NOVEL].

With all formatting advice, your goal is to be as clear as possible without interrupting the flow of the screenplay, keeping in mind that your reader is acting as your viewer. If you are unsure, try to remove yourself from the process, read what you’ve written as though you are a third party, and see if it makes sense.