You know what it's like. You suddenly break out in a sweat because your story isn't working. You tell yourself it's your imagination, that you're overreacting. But you're not. You know this because you can point to why you feel this way. The main character isn't working. The voice isn't distinctive. The plot lacks depth. Not only can you pinpoint the problem, you have ideas on how to fix it. Should you trash the piece, start over, take a break? Not usually. For shorter work, it can help to take a respite to note the problem and possible solutions to avoid ripple effects. For longer work, it's usually best to keep writing, making notes on what needs to change and, if possible, beginning the new tack from wherever the realization hit you. Of course, you'll have to go back and fix the problems starting where they do, but at least your momentum isn't lost, and that's key to finishing what you start, especially if it's a novel.
If you, like most of us, have trouble getting out of your own way to keep working, consider this from Nathalie Goldberg in Writing Down the Bones: "If those characters [writer and editor] in you want to fight, let them fight ... the sane part of you should quietly get up ... and write from a deeper, more peaceful place."