It's been a bleak week or so for the markets. Stocks have plunged, putting the S&P 500 on pace for its worst year in a decade. On Monday, former Federal Reserve chair Janet Yellen expressed fear about another looming financial crisis.

But booms and busts are all part of a larger economic cycle, according to Ray Dalio. And the billionaire Bridgewater Associates founder says there is a way to invest that will help you weather any economic environment.