Having debt doesn’t mean you’re in bad financial shape. In fact, some types of debt are necessary for getting ahead and building substantial wealth.

Debt is often categorized as either good or bad. What that really means is there are types of debt that can hurt you more than they help you namely, high-interest debt.

Most of us don’t have the physical cash to pay for everything we want, whether it be a house, car, vacation, or education. A loan or a credit card can help fill in the gaps, but that’s money you have to pay back, almost always with interest. Oftentimes, that money could be put to better use unless it’s helping you earn even more money now or in the future.

To figure out whether it’s worth taking on debt to finance a purchase, there’s a simple rule to follow, according to Helen Modly , a certified financial planner and private wealth adviser at Buckingham Strategic Wealth who was featured in a recent CNBC article .

“Never use debt to acquire a depreciating asset,” Modly told CNBC when asked about the best financial advice she’s ever received. “For a first-car-after-college sort of thing, use the least amount of debt over the shortest time frame you can afford. Cars, vacations, celebrations should rarely be financed. Houses, business interests, investments, education, etc., can be carefully financed.”

A depreciating asset is something that won’t gain monetary value over time. The chances of later getting back what you paid for it are slim to none. For example, the day you buy a car is the most valuable it will ever be; the minute it begins accruing miles, that’s value that can never be regained. But since many Americans need cars to get around, you should use either cash or a small loan with good terms to finance the purchase.

Similarly, as Modly explained, vacations and celebrations shouldn’t put you in debt. While the things you buy for these occasions may create intangible value, they don’t create monetary value.

On the other hand, taking out a mortgage to buy a house, a personal loan to invest in your business, or a student loan to earn a degree in a high-paying field may be worth the liability. You’ll still have to repay the loan, but the terms are often more favorable in these circumstances. Plus, the asset you have obtained has the potential to increase in value.

“Early in my career, the prevailing wisdom was to only worry about the cash flow,” Modly said. “If you could afford the payments, you could afford the thing or experience you wanted. My first boss explained the difference between debt and leverage and how just being solvent on a cash basis would never create wealth.”