It's a fact of the writing life that at some point you will hate your project and will feel like giving up on it.
It's important to know that this is natural--and not a reason to give up.
This can happen at any point in the project but usually, it happens when we're about halfway through the first draft. At the mid-point, it sinks in that what we've written doesn't match the pristine, perfect version of it we had in mind. Also, there's still such a long way to go.
This is when we may be tempted by another pristine, perfect vision. "Write me instead!" it cries. "I'll be better!" Spoiler alert: it won't. It will have the same or similar issues and you'll hit the same point again.
WHAT TO DO WHEN YOU FEEL LIKE GIVING UP ON YOUR PROJECT
Here's the process I recommend for when you feel like giving up on a project:
1: Step away from it for a week or two. During that time, don't work on it or even think about it. If you've been working hard, take a break. Read some books, see some movies, go to an art gallery or museum, spend some time in a park. See some friends you haven't seen for a while. Eat some ice cream.
2: Return to the project, go somewhere other than your writing desk, and look at it as though somebody else wrote it. Make a list of its good points and weaknesses. You may be surprised to find that during your break from it your subconscious mind was still working on it and now presents you with some new ideas that will improve it.
3: Decide: If a good friend was working on this, would you advise them to give up?
If not, return to it, refreshed and with a better idea of what it requires. Ideally, finish the draft before going back to make changes in the first half. However, if you now have a new approach that changes the first half in a major way, go back and do a quick new draft of the first half, too.
If yes, get a trusted outside opinion. Someone who approaches it with a fresh eye may well be able to suggest the fix that eludes you.
If you still feel like quitting it, go ahead---but not before you think about what you have learned. What was wrong with it? How can you avoid making the same mistake in your next project? When I say dump it, I don't mean throw it away. Put it in a folder and when you've finished your next project go back to it. You may have gained a new perspective and want to take it up again, or you may discover you can use part of it in a new project. Or you may never want to see it again. Either way, you'll know that you gave it a fair shot.