There's a difference between good debt and bad debt. Good debt, like mortgage payments and student loans, can help build your credit while giving you something valuable in return, while bad debt can destroy your credit and take your finances down with it. And nothing screams "bad debt" more than credit card debt, which is why many try to avoid it.

But apparently middle-aged Americans aren't doing such a great job in that regard. According to ValuePenguin's recent data, 45- to 54-year-olds have the highest level of credit card debt among all age groups, with the average borrower in that range owing over $9,000. In fact, 45- to 54-year-olds carry, on average, over $3,000 more than millennials in credit card debt, which is a lot, considering how much more they tend to earn than their younger counterparts.

Earn more, spend more?

Then again, higher earnings could be the reason why so many 45- to 54-year-olds are racking up larger amounts of debt. Those who make more often tend to spend more freely, thinking they can pay off their balances in less time. The problem arises when that doesn't happen, and instead, those same people carry credit card balances for years. And the longer it takes to pay off a balance, the more money there is to be lost to interest charges.

Let's say you make a $5,000 purchase on your credit card, only instead of paying it off in two months as planned, it takes you two years. At 12% interest, which is what many of today's cards might charge, you're looking at about $650 in interest fees. So let's go back to what the average 45- to 54-year-old owes, which is roughly $9,000. When we apply today's rates and a three-year payback period, that's over $1,700 thrown away in interest charges.

The fact that so many 45- to 54-year-olds have such high debt loads means one of two things: Either they're spending more than they should be, or they're unaware of just how much they stand to lose by carrying large credit card balances. And neither is a good thing.

Stop charging, start saving

Here's another reason why 45- to 54-year-olds might be quick to pull out their credit cards: They have hefty expenses to contend with. Mortgage payments, home repairs, and college costs tend to monopolize much of our income once we reach a certain age. The key, however, is to avoid the temptation to whip out a credit card, especially when it comes to non-essentials -- which means anything you don't technically need to be a functioning human. So while food, for example, is something we all require, food from a restaurant is a luxury that shouldn't be charged on a credit card unless you're 100% confident you can pay for it by the time your statement comes due. The same goes for new clothing, electronics, or home improvements.

Want to know what else is technically a non-essential? College. Yes, it has its purpose, but if paying your kids' college tuition means resorting to credit card debt, it's just not worth it.

The more you train your brain to stop falling back on your credit card, the more you stand to save. On the flip side, if you're not careful, you could wind up losing thousands of dollars to interest charges over time.

Getting out of debt

The first step in eliminating bad debt is to identify which credit cards are costing you the most and pay them off. A balance you're carrying at 14% interest, for example, is costing you more than one at 12%. Next, start finding ways to free up cash to chip away at those balances. You may need to cut back on expenses or even take a temporary second job to increase your cash flow, but the sooner you get out of credit card debt, the less money you'll waste on interest.

Here's another tactic for reducing your debt: Say no to your kids. Children can be demanding at any age, but you won't be doing yourself or your kids any favors by taking on debt in an effort to indulge their every whim. If anything, racking up debt near retirement (which applies if you're at the top of the 45 to 54-year-old spectrum) can compromise your long-term financial wellbeing. By failing to eliminate bad debt before retiring, you're increasing your chances of ending up cash-strapped in your old(er) age, at which point you run the risk of needing your adult children to support you. And that's not what you want.

Remember: Getting out of debt is an exercise in self-control. At a time in your life when you've got more important things to spend money on, avoiding useless interest charges will go a long way toward helping you achieve your financial goals.