If you've ever read Shakespeare's Othello you probably know that the titular character kills his beloved Desdemona by smothering her with a pillow. She then laments with her final line, "Nobody; I myself. Farewell: Commend me to my kind lord: O, farewell!" when Emilia asks who killed her.
Now, if you're like me, you'd probably not be able to come back from the dead to eek out that final line if someone has just smothered you with a pillow; neither would you likely die after making this statement. Sure, some may say she got an aneurism, which is what really killed her after Othello's failed attempt; but those people are reaching.
The plot hole in Shakespeare's classic play is not unique to the bard. Many writers have left significant plot holes or errors in their works, either as a result of revision or editing, or simply a mistake in the writing. So how can you, as a writer, avoid writing about a character who has a cigarette in hand who walks into a warehouse, and somehow the gas leak in the warehouse is not ignited (because suddenly the cigarette has magically disappeared)?
Filmmakers utilize a tool that most writers do not use but should: storyboarding. If you are not familiar with what this is, I recommend doing a little research and implementing it in your own process. Storyboarding is essentially a graphic version of each scene, depicted on individual "boards" or panels. Filmmakers use them to arrange and rearrange scenes in a film for purposes of flow, consistency, and visual appeal. They help because most films are not made in a linear fashion, but rather shot as individual scenes and then "cut" into the final work. My own writing is done in this way: I write individual chapters or sometimes just scenes, and then cut it all together in the end before revision.
Storyboarding can help even if you write in a linear fashion. If you can see the "shot" as a drawing, it can help you better visualize the character's perspective; it can help you label different elements that you'd like to describe so you don't fail to tell the reader that the sky was dark or that the mountains in the horizon appeared to be collapsing because of the dust storm that was approaching; and it can help you notice that darn cigarette in Jose's hand just before he enters the warehouse. The picture can help remind you to write in that Jose flicked the cigarette away just before entering the gas-filled warehouse, thus helping him avoid a horrific death.