Great question. I'm sure the answer will vary for each person, and perhaps each person within a given startup. For me, the foremost strategy is always keeping an eye on the greater goal.
For instance, if WordPress was my startup, my goal might be something like: "To give everyone a voice; to allow anyone to publish anything at anytime." That's a broad enough goal that ties back to a personal passion & belief. The exact execution of a goal will vary because of the inevitability of uncertainty. But if the greater goal ties back to something I am passionate about, and is broad enough to interest me, then that motivates me to continue despite setbacks.
Some tactics I've used to reinforce a goal is:
- Declare it openly to friends & family. This uses the peer pressure effect to keep me accountable, and is a tactic some weight trainers recommend to dieters.
- Post it someplace immediately visible. I once had a goal I placed in a sign above my bed. It helped remind me why I was waking up every morning. You can put this sign above your desk or anywhere else that you frequent as well.
Other strategies for dealing with uncertainty:
- Talk to a mentor or advisor. It isn't always easy to find a good advisor within your industry, but if you can, they can be invaluable, especially in times of stress.
- Talk to other entrepreneurs. As evident by online communities such as this one, there are many entrepreneurs willing to lend a shoulder in times of duress. Commiserate with fellow entrepreneurs. Who knows, perhaps they've dealt with the same uncertainty before and can offer solutions.
- Talk to a trusted friend. This is similar to an advisor or mentor, but isn't in your industry. Such a person could be a parent, best friend, or spouse. It should be someone you can totally open up to. Perhaps they won't have the exact answers you need, but as a sounding board, they can be refreshing. Sometimes it's nice to talk to someone outside of your industry.
- Relax. Uncertainty can increase stress for some people, so decreasing it can help clear up your mind for problem solving. I don't mean to sound spammy, but I've written about some of the advice I've gotten on how entrepreneurs deal with stress (some of which is duplicated here, since I thought it was relevant to this question). As ancillary info, that may help some people.
One last note: one of my mottos in life is the Serenity Prayer:
"Grant me the courage to change that which I can, the serenity to accept that which I cannot, and the wisdom to know the difference."
I think this applies directly in entrepreneurship. As you said, there will always be uncertainty. It is inevitable. The best you can do is accept the factors you cannot control (the economy, natural disasters, etc), exert control in the factors that you can change (product features, prices, etc), and know which is which.