In general, debt used to purchase income generating assets is good debt. Debt used to purchase consumable items, or depreciating assets is bad debt. For example, debt used to buy an investment rental property that generates a positive cash flow is good debt. Debt used to buy a car, pay for groceries, or a vacation is bad debt.
Debt used to pay for education leading to a better paying job, career advancement and a greater income is considered good debt. Student loans for a degree in a field with no job opportunity or a very low paying job is probably bad debt. What kind of job will pay a philosophy major enough to live on and also pay off the student loans? The debt incurred to obtain a PhD is probably bad debt if you end up being a cab driver.
The debt used to purchase a primary residence is bad debt but necessary. A primary residence does not generate any income, but the debt service is a liability until the property is paid off. Now you may argue that the primary residence appreciates and you realize a profit (income) when you sell. In principle, I agree, but appreciation is not guaranteed and usually slow when it happens. If you hold the property long enough, you should realize some appreciation but consider that you are paying interest on your loan while the property is appreciating. If you hold the property long enough you might break even. For example, if the house you paid $100K for 30 years ago is now worth $250K you see this as a potential $150K profit when you sell. However, consider that you paid a total of $250K in principal and interest for 30 years to retire your loan, You just break even at best. There are a few real estate markets where this is not the case, but for most real estate markets, home ownership iis more expensive than renting -- especially if you sell and move in every few years.
If you ever plan to use credit you need to have credit available . 35% of tour credit score is driven by Payment History, so in order to further enhance your credit profile and increase your credit score you need to have a credit product (loan, personal loan, line of credit, mortgage, auto loan, credit card. Etc that generates a statement with a balance monthly that would require you to submit some payment . What is required in each individual part is to use credit responsibly so as to have it reported favorably on your behalf.
35% of your credit score is driven by Payment History. So you need to have a payment reported to the credit bureaus on a monthly basis to show that you are capable of being on time with your payments . Getting a credit card is the easiest way to get and enhance your credit profile
Debt is only bad if you cannot manage it. I have two credit cards and two bank loans under my belt and them alone put me at 710 credit. You just have to be smart as well as not put too much financial burden on yourself