Deus ex machina has a bad reputation. And not without reason. This highly contrived way of solving an unsolvable problem in a work of fiction is one of the hallmarks of sloppy writing. Still, as a plot device, deus ex machina isn’t 100% bad if you know how to use it correctly.