Sometimes, stories don't go anywhere. If you hit that point where you realize it's not going anywhere, you have two choices, I think: scrap it, or figure out why.
Scrapping it is easy because giving up on any story when it gets hard is easy. Just look at the millions (probably more like a few hundred) unfinished stories in my files.*
But if you believe in the story and still want to tell it, scrapping it is only the first step: 1. Make the decision to no longer slam your face into the brick wall of a story that isn't working. 2. Replan and start over from scratch, trying not to make the same mistakes. 3. Actually start over.
If you decide to figure out what went wrong without scrapping it first, it'll probably not be as easy as just starting over or giving up and starting something else. But at the same time, in my experience, it's usually been one of three things that messed it up:
1. The story has mutated and you were trying to make it still fit the original plan
2. You don't know the characters and what they want well enough
3. It's actually your life that's spinning but going nowhere, and the feeling is bleeding over
In the case of the first, you'll need to back up to where the mutation happened, look at it critically, and decide whether you want to keep it, scrap it and go back to plan, or work around it. Keeping means you'll have to figure out how this unexpected change ripples out to the main story and all the subplots so everything still tied together and makes sense. That can be really fun, because it makes you think about what your story even is differently.
If you decide to ditch it, you might wind up rewriting a lot of the story, but it'll be closer to what you were originally aiming for. But ask yourself: why did it change to begin with? If it was because you were bored, maybe you should keep it; a bored writer makes boring stories! If it was just a random flash of weird inspiration, keep it in another file; maybe it's a different story trying to jump the line!
And if it's the third option, you'll have to figure out what went wrong in your actual life. Do you need more time to destress? Do you need to talk to someone? Do you need to rearrange what time of day you do stuff in? Do you need to make a bigger change--moving, getting a new job, changing your relationships?
Those are all brain-filling things, and stressing out additionally over what you're writing won't help you or your book. If it's your life that's needing editing, my advice is always to focus on that--but don't give up writing entirely. Work it into the new patterns you're forming. Lower your daily or weekly goals to where you can still hit them, but they take less time and effort, but keep writing. Even if it's just one page or one line a day. Even if it's just a scribbled note in your notebook** to keep the idea ticking over in your head until you have time to focus. There's nothing sadder than a good story abandoned because the writer's life caved in and there wasn't time for it anymore.
That's how I handle when my stories aren't going anywhere. How do you do it?
*I keep all my stories, unfinished or not; you ever know when it'll suddenly work, or when that really great single paragraph or storyline will fit somewhere else. Also, I hate reinventing the wheel I already spent so much time inventing. Also also, I'm kind of a packrat.
**Because of course you have a notebook or it's equivalent for catching inspiration, right?^
^::steps off soapbox now::