I don't have anything with regard to the excellent tips already posted but perhaps my own experience will be worth reading to some.
I've always enjoyed writing and took creative writing through my school years. My profession has nothing to do with writing but occasionally the muse struck and I wrote a number of short stories (that I showed to very few people) and had a few magazine articles published. As many do, I always wanted to write a novel some day. Finally came the realization that I needed to actually do it or wait for the next lifetime.
I decided that I wanted the $$ to go along with the fame and started a thriller as I thought that genre had the most potential for commercial success. I kept it a secret until about 1/3 through the first draft when I showed it to my wife and asked for her honest opinion. She told me it sucked. She was right.
Inflection point: Try again or quit? Answer: Try again, but redefine goals before doing so.
The new goal became to simply write the best novel I could. When I was done, and knew I couldn't possibly make it any better than it was, then I would do my best to coldly assess whether it was good enough to seek publication. Potential $$ and/or prestige and/or fame were not part of the new equation.
Next, I figured that the best way to find and keep the motivation to see the project through would be to write a novel that I would enjoy reading myself. Historical fiction is my favorite genre and I like adventure, so I picked a colorful time and place in American history (1848 along the Mississippi River), spun up a fun outline, and dove in.
I set a goal of one year to completion because I didn't want to be one of those middle-aged amateur aspiring novelists who drag things along for 2 or 3 years. I finished the first draft in 14 months, which I didn't think was too bad, and figured on a few months of revisions. I continued to work on it steadily, with only a few writing droughts, and completed the novel, start to finish, in five years.
Yeah.
I numbered my revisions like software, with an new integer representing a complete beginning to end rewrite, and decimals to indicate significant but smaller revisions. At version 7.5 or so I realized that the book needed to be better, and could be better, but I could no longer see how to do it. I hired the best editor I could find, and it was like receiving a 1 on 1 post graduate course in novel writing. Worth every last expensive dollar.
My goal was to write the best damn book I could, and at version 12.7 I knew I had done it. Yes, I wrote and re-wrote it from beginning to end twelve times and revised it many more times than that.
As a lifetime voracious reader and dilettante writer I thought I had a good idea of the work it would take to write a novel. It turns out I had no f'ing clue. It was one of the hardest and most fun and most satisfying challenges of my life and, no false modesty here, I've met some big challenges before.
Which leads me to what I wish to contribute to anyone thinking of writing a book or books: The single biggest factor is motivation. Without serious motivation, sustained through the ups and downs, it won't get started or it won't get finished or it won't get revised to the point of being good. Motivation.
For me, sustaining motivation came when I redefined my goals and began to write a story that I enjoyed even as it flowed out of my brain.
Once I was done I decided it was good enough for the world to see and, in a business decision, self-published. It has achieved only modest success despite good reviews. My daughter, who is an LA actress, is a champion of the book and swears she's going to see it made into a movie some day.
Whether that happens doesn't matter, because I wrote the best damn novel I could. Mission accomplished.