Charles Schwab democratized investing, giving small investors an opportunity to buy a piece of growing companies in the stock market. His entrepreneurial journey wasn't an easy one. When Schwab opened his discount brokerage firm, he was living in a tiny apartment while paying off loans and debt. Today, he's worth about $8 billion.

While Schwab's new autobiography, Invested, doesn't give you the formula for becoming a billionaire, it does give you a glimpse into the mindset of a successful entrepreneur. Schwab says one habit gave him an edge: thinking optimistically.

An optimist, Schwab says, knows that the future will be better than the past. As an investor, if you don't think the future will be better than the past or the present day, you'll avoid buying stocks or you'll sell at the wrong time--when everyone else is panicking. If you're thinking of starting a company, you'll give up in the face of setbacks and hurdles that happen to any startup. Optimists, however, "believe in the innovations that come from the human mind and the human spirit," says Schwab.

Fear and panic are especially powerful emotions that are highly contagious, infecting everyone around you. Schwab says basing your financial and business decisions on the emotions of the moment is the worst thing you can do.

For example, Schwab's company went IPO in September 1987. In October, the stock market collapsed. Schwab stock went from $16.50 to $6 a share by the end of the year. Many investors sold their shares and never got back in. Those who were patient and had a long-term perspective were rewarded many times over. If you had invested in Schwab stock 32 years ago and held on through recessions and stock market downturns, your original investment would have grown by 21,000 percent.

Optimists like Schwab have built up an immunity to mass panic because they have perspective. Here are three ways to build the perspective you need to make smart decisions.

1. Read more than average.

Successful leaders and entrepreneurs read far more books than average. Schwab is no exception. He can "roll with" business setbacks and stock market crashes for two reasons. First, he's lived through them and has the benefit of experience. Second, he started a reading habit when he was young. "I became increasingly interested in what makes one person succeed in life, and another languish. I read lots of biographies of people who had accomplished great things...I saw the importance of optimism and believing good things are possible."

2. Hang out with positive people.

Successful entrepreneurs know the importance of empowering relationships. In a recent episode of his popular podcast, author Tim Ferriss was asked for the one piece of advice he'd put on a billboard. Ferriss answered: You are the average of the five people you associate with the most.

If emotions are contagious, then it makes sense to spend less time with pessimists and more time with people who will lift you higher. By reading books about great people, you'll understand the long-term perspective that inoculates them against the pessimism that often infects the people around them.

3. See problems as opportunities.

Re-framing problems as opportunities is another theme that recurs in the autobiographies of successful entrepreneurs like Schwab. They turn personal or business challenges into something positive. For example, Schwab is dyslexic and devotes more than a dozen pages to how he turned the condition into something positive. Although dyslexia made reading a challenge, it allowed Schwab to "think differently, more conceptually," which he credits for helping him build a company that would upend the traditional way of investing in stocks.

According to Schwab, our natural instinct is to run for the door at the first sign of panic. Although it can seem "like a little bit of a nightmare" to go against the crowd, Schwab says you'll be more successful by hanging on and "looking forward to a better day."