Quitting is not easy.
Especially when you are invested in something with all your heart.
But sticking to it even when you know that there is almost no likelihood that it would work is taking away from yourself the chance to work on something better, something worth pursuing.
Again, it's not easy. But it's the only way forward.
Annie Duke's book Quit is excellent. Here's a quote from it:
...the real goal in climbing Everest is not to reach the summit. It is, understandably, the focus of enormous attention, but the ultimate goal, in the broadest, most realistic sense, is to return safely to the base of the mountain.