Generally Deus ex Machina is considered a plot weakness — an unsatisfying, easy fix to a conundrum, or problem, developed throughout the tale.
Euripides was an ancient Greek playwright who first used Deus ex Machina. Many say his writing was weakened by the use of this technique, however, many others say that he used this technique more as an epilogue.
More at jstor.
An example of Deus ex Machina is The Wizard of Oz.
More at: youtube Wizard of Oz movie clip.
1. Write a short story.
2. Include a problem with no apparent solution.
3. Conclude your story using Deus ex Machina. (It’s okay to make it comedic.)