Good debt, bad debt
There are two ways to look at whether debt is good or bad. The less important way has to do with the terms of the debt itself--how high the rate is, whether it's fixed or variable, any prepayment penalty. The more important factor in determining whether debt is good or bad is how you spend the money. From best to worst, here are the categories of debt that I use.
A productive asset
The only really good debt is debt used to purchase a productive asset. If you run a coffeee shop that's losing customers because your baristas are having to wait to get to the one espresso machine, then borrowing money to buy a second espresso machine would be good debt. If you're a landlord, then using a mortgage to buy a small apartment building would be good debt.
Student loans fall into this category as well, if the degree will increase your future earnings.
The key item here is: will whatever you're buying earn you enough more to service the debt? If so, it's good debt.
Something you can easily afford, but don't have cash for
A mortgage on your home usually falls into this category. (I say "usually," because it's become all too common for people to buy houses that they really can't afford, hoping that rising incomes and rising property values will bail them out. That sort of debt falls into the next category.)
As an aside, a lot of people like to imagine that their mortgage falls into the previous category, on the grounds that their home is an "appreciating asset." Home appreciation, though, is an artifact of growing incomes and expanding cities, and is not a law of nature. Hard economic times could very easily depress home prices and keep them depressed for years. Unless your home is actually earning income somehow (by letting a room out to a border, perhaps, or by earning fees from Hollywood as a film location), then it falls into this category.
Other small debts can fall into this category, especially for a young person looking to establish credit. (Back in the days before credit card companies pushed cards onto every college student with a pulse, you could read whole articles with advice that boiled down to: pick something that you were going to buy anyway, take out a loan for it from your bank or credit union, make payments on time, make the last payment a little early.)
Something you can barely afford, but have to have
For most people, a car loan falls into this category. (I'd like to suggest that a lot of such people have never given bicycling, walking, and taking the bus adequate consideration, but that's neither here nor there.)
In the United States, medical care expenses often fall into this category.
These are the debts that drive people into bankruptcy, because anything you can barely afford leaves you vulnerable. What if there's a little hiccup in your income? What if there's another unavoidable expense?
Something you don't need, whether you can afford it or not
I'm not going to bother making a list here. Things in this category are different for everybody, and yet all the same.
Although the lenders lobby would have you believe that debt in this category is what drives people into bankruptcy, that's rarely true. That's not to say that this category doesn't cause a lot of pain. There aren't many people who don't have credit cards--and there aren't many people with credit cards who haven't at some point found themselves at the end of the month with more owed on their cards than they can pay. Do that a few months in a row and suddenly the minimum payments on your credit cards start looking like an expense category of their own (which they aren't).
Getting a bit over your head buying stuff you want hardly ever leads to bankruptcy, though. What leads to bankruptcy is buying stuff that you simply have to have and then running into a problem (job, health, family, business, economy) that either cuts your income or raises your expenses to the point that you can't service the debt.
What does this mean?
First, stay as close to the top of this list as possible. It can seem tricky to distinguish between the "stuff you can easily afford" and the "stuff you don't need," but it's not, really. Maybe when you're in the stage in life when you're setting up your first household (and need basics like furniture and kitchen appliances) it can be confusing, but there's really very little that you can easily afford but don't have the cash for, except a house.
Second, be especially careful with the "stuff you can barely afford, but have to have." People put themselves through a lot of unnecessary pain buying stuff they don't need, but those purchases rarely ruin their lives. These do. If you can barely afford it, be very, very careful. Comparison shop. Buy the least you can. Make do with what you've got as long as you can. Very often, just a few months of "making do," can change a "barely afford" to a "easily afford" by letting you save up a larger down payment. Sometimes it'll teach you that you were simply wrong in thinking it was something you had to have.