Although learning how to invest can seem like a daunting task, putting your money to work while you sleep is a key step to gaining financial independence and retiring comfortably. And, it doesn't have to be scary. Anyone can develop a smart investment strategy by following a three-step formula, according to Ray Dalio, a renowned investor and founder of the world's largest hedge fund, Bridgewater Associates. Today, Dalio is worth an estimated $18 billion according to Forbes, but he founded Bridgewater Associates in his two-bedroom apartment in New York in 1975. From its founding through 2017, Bridgewater returned the biggest cumulative net profit for a hedge fund ever, according to data from LCH Investments. For anyone new to investing, here is Dalio's three-step advice to get started.

1. Decide how much you can sock away

"Savings equals freedom and security," Dalio tells CNBC Make It. "How much freedom and security do you need?" "Ask yourself, 'How long can I get by on my savings without having any income? How many months or how many years of freedom and safety do I need?' and make sure that you have more than that," he advises. "When I started working, I worked to get six months of savings freedom and security, then a few years, then I started to think about my kids' needs over time and I calculated that number," Dalio explains. "I saved to get those amounts of money. I recommend that you do the same."

2. Create a diversified portfolio

The next step is to decide what to do with that money. Keeping all of your cash in a savings account isn't a smart decision, Dalio points out, because of the value depleting effects of inflation. Right now, the national average interest rate for a savings account is only 0.10 percent, according to data from Bankrate, meaning you're only earning a few cents for every dollar you save. Meanwhile, the consumer price index — which measures inflation (the rising costs of goods and services) — rose 2.7 percent in the past year. "That's the worst thing you could do because it is the surest tax on your money," Dalio says. "You will bleed slowly to death because the after-tax returns are lower than inflation by a little per year." In order to prevent your savings from losing their value, the best choice is to invest your money into a diversified portfolio of assets that increase in value faster than inflation. "Know how to diversify into non-cash assets like stocks, bonds and real estate," Dalio says. A typical portfolio might be split between 50 percent bonds and 50 percent stocks, but Dalio argues that isn't really diversified in "Money: Master the Game" by Tony Robbins. "When you look at most portfolios, they have a very strong bias to do well in good times and bad in bad times," Dalio says in the book. To avoid your portfolio simply rising and falling with the market, his advice is to spread out and balance the risks of each investment. Here's his breakdown for what a well-diversified portfolio might look like, according to the book: 30 percent allocated to stocks, 40 percent to long-term U.S. bonds, 15 percent to intermediate U.S. bonds, 7.5 percent to gold and 7.5 percent to other commodities. (The portfolio does need to be rebalanced annually, he adds.) That mix is intended to do well under any condition, whether the economy is growing or shrinking, or whether inflation is rising or falling, he explains.

3. Learn the market's long-term cycles