It's no secret that healthcare is expensive, but it's gotten to be such a burden that a growing number of Americans are struggling to pay for it. In fact, medical debt is the No. 1 source of personal bankruptcy filings in the country, and it's not just the uninsured who have a hard time keeping up; a good 20% of Americans with insurance under the age of 65 also have trouble covering their costs.

So which age group owes the most in medical debt? Surprisingly, it's not seniors, who are increasingly likely to have health issues because of their age, or even baby boomers, who are right behind. Rather, it's Gen Xers -- adults in their late 30s to early 50s -- who have managed to rack up the greatest load of health-related bills.

A man in bed looking at a thermometer

IMAGE SOURCE: GETTY IMAGES.

According to data from Comet, the average Gen Xer owes $19,670 in medical debt. Millennials, by contrast, owe an average of $11,622. And while baby boomers are more likely to have medical debt than younger Americans, they also owe the least -- just $2,408 on average.

Why are Gen Xers in such a hole? Call it an ongoing trend. In addition to medical debt, Gen Xers also carry the highest levels of credit card debt. Now on the one hand, that's surprising given that most Gen Xers are pretty advanced in their careers. On the other hand, many Gen Xers have mounting bills to contend with, from mortgage payments to college tuition, and as such, their financial resources might already be drained by the time those healthcare bills come around.

The problem, of course, is that any amount of medical debt could wind up hurting you financially. Not only might you rack up interest charges by paying medical bills off over time, but carrying too much debt of any kind could cause your credit score to drop. That's why it pays to take steps to lower your healthcare costs. And in this regard, you may have more options than you'd think.

Understand your benefits

Believe it or not, one of the easiest things you can do to lower your medical costs is to get a better sense of what your health plan will and won't cover. Sadly, it's estimated that only 52% of U.S. employees fully understand their health benefits, which means that nearly half the population is at risk of making poor choices, like failing to obtain referrals or seeing out-of-network providers, that can cause medical bills to skyrocket. A better bet? Carve out an hour or so of time to review your benefits thoroughly, and call your provider if there are areas you're still struggling to understand. The more knowledgeable you are about your benefits, the greater your chances of spending less.

Invest in decent insurance

Whether you receive health insurance through an employer or buy it yourself on the open market, you may be inclined to opt for the least expensive option available. After all, the less you pay in premium costs, the less you'll end up spending, right? Wrong. It could very well be the case that a cheaper insurance plan with a relatively low premium ends up costing you way more out of pocket when you factor in costs like deductibles and copayments. Therefore, while it might seem counterintuitive, you could end up coming out ahead financially by purchasing a pricier plan with superior coverage and fewer out-of-pocket costs. This especially holds true if you tend to get sick often, or have a preexisting condition to manage.

Always have emergency savings on hand

A big reason why so many U.S. adults wind up with medical debt is that their expenses come in higher than anticipated, and they don't have the extra cash on hand to cover those bills. That's why it's crucial to have emergency savings -- to pay for life's unknowns, including medical care. Ideally, your emergency fund should contain a minimum of three months' worth of living expenses, but if you're able to stash six months' worth in the bank, even better.

Of course, you shouldn't necessarily use your emergency fund as a crutch in the face of prospective medical bills. If you look at your personal history and see that you tend to incur a $500 healthcare expense once a year, you should plan for it accordingly rather than assume you'll just dip into your savings. But if you do save for that $500 expense and it becomes a $1,500 bill, you'll be more than justified in tapping your reserves.

Get ahead of medical issues before they escalate

One final way to keep your healthcare costs to a minimum is to see your doctor when you first get hurt or start to feel sick. Countless folks put off medical appointments because they don't want to pay for them or make the time, but if you allow a health problem to worsen, its associated costs are likely to climb.

Imagine, for example, that you cut yourself deeply and attempt to bandage the wound yourself rather than head to an urgent care clinic. You might stop the bleeding, thus saving yourself what's probably in the ballpark of a $50 copay. But if that wound gets infected and you need IV antibiotics and a hospital stay to treat it, you could wind up several thousand dollars in the hole -- all the while compromising your health in the process.

Though medical care is unquestionably expensive, you can help yourself by taking steps to keep your costs down. The more proactive you are, the less likely you'll be to join the ranks of the many Americans whose debt stems from healthcare alone.