Here's how (and how not) to wrap up your story.
|Every scene in a story ends with the protagonist failing to achieve an intended goal. The penultimate scene in the story must differ from the earlier scenes in some structural way if it is to function as a climax. There are three ways to do this.
1. Arbitrary Success
The protagonist's earlier failures to achieve intermediate goals are zeroed out by his timely ability to realize his ultimate goal.
2. Deux Ex Machina
The protagonist fails to meet his ultimate goal, just as he failed to meet his intermediate goals, but is rescued by the timely intervention of an external force.
3. Earned Success By Unexpected Means
The protagonist fails to meet his ultimate goal, just as he failed to meet his intermediate goals, but is given a timely and successful second chance to fulfill it through the intervention of an outside force that is itself the delayed and unanticipated consequence of characteristic actions performed earlier by the protagonist.
"Arbitrary Success" fails to satisfy because nothing explains why the protagonist succeeded at meeting his ultimate objective despite failing at all his intermediate objectives.
"Deus Ex Machina" fails to satisfy because the final success is unrelated to the protagonist's own efforts.
"Earned Success" works because the protagonist's record of failure stands, but his final success is still related to his earlier efforts, which were themselves characteristic (non-accidental byproducts) of the protagonist's deepest desires and best qualities. Ultimately, he succeeds not through effort but as a reward for being or evolving into the kind of character who deserves to win.
NB: The above apply only to conventional narratives with non-tragic, non-ironic conclusions.
Source: Dwight V. Swain
For more: "Storytelling Catechisms"