Put whatever is not working away for a while, then try to reread it as if someone else wrote it. Maybe the story isn't what you originally envisioned, but it may be much better if you go with what it's turned out to be.
Or try working on something else. (I have seven novels in progress right now and expect to finish all of them one day.) If your subconscious is like mine, it wants to work on anything but what your conscious brain is trying to do.
I also find that research sometimes helps. It may give you a fact or line of inquiry that connects apparently unrelated ideas.
Try bouncing the story off another writer, a librarian, creative writing teacher, or local full-service book seller familiar with your kind of story.
Join a writer's group in your area (geographically and genre-wise). Be careful. Some groups are toxic--it's always easier to bitch than come up with constructive comments. Don't put up with criticism like "I just didn't like it." Good criticism goes something like "Too many sentences start with participle phrases" or "You spend too many words describing scenery or clothing, not enough developing character or describing action" or "The paragraph has two run-on sentences" or "Your pronouns don't agree with the nouns they refer to" or "You put your entire backstory in chapter one. Save most of it for later." Good groups are hard to find and hard to get into, but well worth the trouble.
If you haven't already, read On Writing by Stephen King, The Artist's Way by Julia Cameron, or Writing Down the Bones by Natalie Goldberg.
Also check out How to Write Killer Fiction by Carolyn Wheat, Getting the words right: How to Revise, Edit & Rewrite by Theodore A. Rees Cheney, and Story by Robert McKee.
Attend a writer's conference like Love is Murder or Left Coast Crime. Hanging out with other's who share your passion usually fuels the creative fire.
Go to a great movie, play, art exhibit--something stimulating and unrelated to your story. It will ignite your creativity.
Take a ride on a bus or the El (or Metro, or subway). Eavesdrop in a restaurant or in line at the grocery store. Take a walk and read the graffiti.
Keep writing but don't try too hard.
Don't give up.
Do have fun.