A mentor of mine has saying that startups are an emotional rollercoaster. One week you are high of the positive feedback after pitching to an investor, next week you realize that they are still far from investing. One week you get tons of work done, next week you bang your head against some stupid technical problem that you thought was trivial. One week you have a spike in adoption curve for a random reason, next week it flattens for apparently no reason.
You just have to learn to ride the emotional rollercoaster. For some people, it comes naturally. They are confident and positive, constantly living in their own reality distortion field. Some analytical people have doubts all the time.
If you have doubts about your capability to execute, consider that as part of the business and just push through the emotional low back to high.
But if you have doubts about your overall idea, then you just have to go back to the idea. Why I'm doubting it? Idea should be something that you think has obvious potential and you just wonder why others aren't doing it. Often times it's enough to adjust your original idea a bit. Get feedback, fresh perspectives. Pivot. And you suddenly feel confident again.