In some of my stories the end has been obvious from the get-go, but in my current project, revisions to the rest of the story have forced me to rethink its conclusion.
The conventional wisdom is that a great ending should be surprising but inevitable, and in a mystery or thriller, probably doubly so. Maybe you can guess what happens, but not the how. Or maybe there's a revelation that makes you realize what you subconsciously knew all along about a character. Of course, if there's a ingenious twist, it may have you reevaluating the entire story up to that point.
And then there's the notion that the ending has to be earned—that it matches the promise of your beginning and middle. It's gotta be big, or at the very least, important.
So tell me about your experience. Where do you find that ending that makes the whole thing feel worthwhile? Do you know before you even sit down to write? Is it already hiding in the story, a thread that only needs to be plucked out? Is it simply a matter of putting yourself in your readers' shoes? (As if that's simple...)
P.S. Don't watch this video if you are spoiler-averse.