If legendary investor Warren Buffett could give one piece of advice to young people, "it would be just to don't get in debt," he told a 14-year-old shareholder at the 2004 Berkshire Hathaway annual meeting.

"It's very tempting to spend more than you earn, it's very understandable," he said. "But it's not a good idea."

And if you're deep in the red, it may be a good idea to "never look at a credit card the rest of [your] life," Buffett added.

Billionaire entrepreneur Mark Cuban agrees that you should avoid debt if you can. The best investment anyone can make, he says, is "paying off your credit cards. Paying off whatever debt you have."

Cuban, who struggled to keep himself on the right side of his credit card debt in his 20s, learned the hard way that the money saved on interest by not having debt is better than any return you could get by investing your money, whether in the stock market or in real estate or elsewhere.

"Whatever interest rate you have — it might be a student loan with a 7 percent interest rate — if you pay off that loan, you're making 7 percent. That's your immediate return, which is a lot safer than trying to pick a stock or trying to pick real estate, or whatever it may be," he says.