Quite rightly, we're all told we have to make the openings to our stories gripping, intriguing etc to draw the readers in. Also quite rightly, we're all told our endings have to finish the story off properly and leave the readers feeling as if they have had a good, satisfying read.
However, without the hardworking, load-bearing middle of the story doing its part well, the ending will, at best, sag and, at worse, collapse. It won't matter how brilliant the start to your story was either. People will be turned off by a middle section of a story that doesn't work as well as the start and you'll lose them. They'll probably never get to your excellent ending!
I find the only way to ensure my story middles do not sag is to outline the major steps of my stories. I deliberately don't outline every single one. You want to leave room for the old creative spark to fire up but I have found outlining the major building blocks means my middles are well thought out and, far from being restrictive, my plan encourages the old imagination to work that much harder because I've given it something to work with in the first place.