This answer is pretty simple. In my opinion, writing a novel takes two things: a good story and perseverance.
If your story doesn't interest you, then that creates a two-fold problem. One: if you're not interested in it, then your reader definitely won't be interested in it. Two: if you're not interested in it, then you won't finish it. And if by chance you do finish it, it will be done more out of drudgery than enjoyment. If you're writing a novel, then you should be enjoying it.
PERSERVERANCE IN WRITING
This is where perseverance comes into play. Even if your story is interesting and you're enjoying writing it, there will be times that you won't feel like writing anymore. You'll feel you are done. Giving up. Tossing in the towel. Feeling this way may be from just sheer mental exhaustion, not seeing an end in sight, or continual writer's block.
If you are suffering from mental exhaustion, then I suggest you take some time away from the project. Like Joe Hill (really Joe King, son of Stephen King) said, don't listen to people who say write like there's no tomorrow. Write like there is - your project isn't going anywhere. Take your time with it.
If you don't see an end in sight, just keep writing, The end will present itself. Don't try to write the ending, let the character(s) do that for you.
If you have writer's block, listen to this piece of advice I got from a Writers' Digest magazine: Write even when you don't feel like it. Write when there is no passion in it. Write through your writer's block.
CLIMBING OUT OF THE WRITING HOLE
I still have that magazine, just as a reminder for myself. Don't stop writing just because you are stuck. That's like being in a hole and wondering how you are going to get out when the only possible way is to climb. Writing a novel is a climb, whether in a hole or on a mountain. Eventually you will make your way out or to the top.
When I wrote Fight, I had a great time writing it. The characters were taking me on a great ride, but there were times I struggled to get through. The hardest was near the end. I wasn't sure who should live, die, or otherwise. I wanted the climax to be as intense as possible. So I wrote it several times. I left it alone for a little while. I stared at my computer screen trying to figure out the best ending. As frustrating as it was, I wanted to write it. I didn't want it to just come to an end. I wanted to write a great ending.
I will give everyone the benefit of the doubt that if you're writing a book, then it's a good story (or at least you are interested in it). That being said, it's all about perseverance. Struggle on. Keep writing. It's that easy. And quite frankly, even that's easier said than done.