There are a lot of opportunities to walk away from a project. Good times to say "this isn't working" and "maybe I'm wasting my time." It's important to know when to drop a project. That's a lesson that takes time to learn, especially when you're starting to "get good" at writing but aren't "quite there" yet. Sometimes, the writing itself is good, but the plot pieces don't fit, scenes feel out of place, and nothing goes anywhere. It's so tempting to try to wrestle that story into place and force it to be what you wanted it to be.
If the story is something you don't want to throw away, and if you genuinely believe you CAN fix it, BUT you're having so much trouble that you're not being productive, it's time to step away. Some books should be trunked (NEVER to be seen again unless you want to use them for educational purposes in one of our trunk novel segments), and some should be shelved (to be returned to at a later date).
I'm facing this situation right now. You see, I finished the first draft of a novel back in December. I really like a lot of the scenes, the characters, and parts of the story arc. But many of the vital plot points turned out to be troublesome. I didn't buy them as likely causes/motivations/believable sequences of events. There's a lot that I feel is well crafted in this draft (though the basics still need some solid polishing), just not the story itself. Or the main character's motivation. Both of THOSE are vital elements to a good story, let alone a great story.
But I'm not trunking it, yet. I'm working on something else. A new novel. One that's just flowing right now (I got 1,500 words written yesterday!). I'm hitting pause because spending a lot of time with this broken book could end up being a waste. I need to be writing, stretching my brain-muscles. The part that's supposed to be able to FIX these story problems just isn't working as well as it did for the novel I'm querying right now, which means I need to work it to get it back into shape.
For writers, it's vital to write every day. Even if it's just 200 words. Editing isn't writing. Staring at the screen isn't writing. Working on story ideas and plotting comes CLOSE, but it's still not WRITING (though all of those things are IMPORTANT). And I'm not getting any younger. If I want to make a career out of my passion for story, I need to knuckle down and produce stories. My goal, from here on out, is at least one a year. One novel each year that I can query.
But that's a different post.