Read this:
Then think about a story. TV show. Game. Movie. Book. And notice how well it applies.
Then make sure it applies to your game.
Edited on a computer: This was shown to me in the context of Breaking Bad, but applies to almost every story I can think of now that I know about it. Maybe puzzle games don’t fit the bill, but an effective story starts and ends in a place of comfort.
From here they either have a goal, you accomplish the goal, win, and are comfortable.
Or you have a goal, accomplish it, realize it was a mistake, learn from it, and move forward with this new knowledge.
(sorry for the non-linkified link. I’m on my phone.)