[Picture by Praetoris01]
But what is a Deus Ex Machina and how can you discover it yourself if you used such one in your own story? Let me firstly begin with the definition.
A deus ex machina (/ / or / / DAY-əs eks MAH-kee-nə; Latin: "god from the machine"; plural: dei ex machina) is a plot device whereby a seemingly unsolvable problem is suddenly and abruptly solved with the contrived and unexpected intervention of some new event, character, ability, or object. It can be roughly translated as "God made it happen," with no further explanation, and, depending on usage, is primarily used to move the story forward when the writer has "painted himself into a corner" and sees no other way out. However, in other cases, it is used to surprise the audience, or, commonly influenced by editors and/or publishers, bring a happy ending into the tale. Source - Wikipedia
Now i will tell you how you could discover such a situation in your own work. You used a Deus Ex Machina device whenever your main character solves a problem without working it out himself. This could be the case if your character develops a power that wasn't teased before, or an magical object gets activated, or someone mysterious saves him or a unknown higher power helps him out. There are many more possibilities but these are the most common in books.
Using this device isn't bad for the first draft but you should get rid of it at the revising phase. But how? Thats really easy but sometimes it changes your beloved character... entirely. Every situation should be solved instead by your character through his actions, even if it breaks him. If he can't rescue himself then let him die in vain. It may be a harsh ending but thats the one which would naturally occur. If you don't want him to die, then you have only 2 possible options.
1: Use a deus Ex Machina and keep on writing. Try to change that with your next work.
2: Change the previous chapters and give him the possibility to develop a method to save himself.
If you change these situation you add deep to your characters and make your story more believable which could lead to better reception of readers.
Do you have Deus Ex Machina Moments and if, could you get rid of them? How did you do it?