Certain financial habits can really get us into trouble, and relying too heavily on credit cards is one of them. But while Americans have a tendency to charge more on credit cards than what they can afford, new data from listing service Clever reveals that 47% of Americans carry some sort of balance from month to month. And only 30% of Americans with credit-card debt think they'll manage to pay it off within a year.

When we think about why Americans wind up racking up debt and carrying it for months or years, it's easy to point a finger at things like impulse shopping. But in reality, the reason many folks land in credit-card debt often boils down to emergencies.

Couple at laptop looking concerned, with woman holding credit card.

IMAGE SOURCE: GETTY IMAGES.

Whether they're home related, car related, or medical in nature, financial emergencies can happen to all of us. The problem, however, is that most Americans don't have the savings to handle them. An estimated 58% of U.S. adults have less than $1,000 in the bank, which means that if they're hit with an unplanned bill, they may have no choice but to rack up credit card debt and carry a balance for months on end.

If you're currently in debt because an emergency forced you to charge up a storm, it's imperative that you build some savings to ensure that that doesn't happen again. And if you've yet to fall into the unwanted-debt trap, consider yourself lucky -- and start building savings before you end up putting your finances at risk.

Establishing your emergency fund

Though there's no single savings amount that guarantees you'll be able to cover the surprises life throws at you, as a general rule, a true emergency fund is one with enough money to cover three to six months' worth of living expenses. If you're nowhere close to the low end of that range, you'll need to rethink some of your spending habits to change that.

You can start by creating a budget if you don't have one already, seeing where your money is going, and cutting back on nonessentials, whether it's restaurant meals, clothing, or entertainment. Another option? Cut back on one major expense, like your rent or car payment. If you downsize to a smaller space, you might free up several hundred dollars a month. Similarly, if you give up your vehicle and take public transportation instead, you could save thousands over the course of a year.

In addition to lowering your spending, it pays to think about getting a second job. The beauty of working a side gig is that your earnings from it won't already be earmarked for existing bills, which means you should be able to save every cent you earn (minus what you owe the IRS for taxes). And you don't need to resign yourself to some dull, tedious job to bank some extra cash. These days, you can turn just about any hobby into a side hustle, whether it's crafting, writing, or playing an instrument.

Finally, resist the urge to spend whatever extra money comes your way during the year, and put it directly into the bank instead. We're talking about things like your tax refund, cash gifts for your birthday, or bonuses paid from your job.

Once your emergency fund is complete, you can continue to uphold your savings habits until you've managed to pay off whatever debt you've been carrying. But make no mistake about it: You should first establish emergency savings and then pay off existing debt. Without money in the bank, you risk racking up even more debt the next time an unanticipated expense hits you out of the blue.

It's one thing to charge expenses on a credit card and pay them off by the time the associated bill comes due, but it's another thing to carry a long-term balance and rack up loads of interest in the process. If you'd rather avoid that fate due to circumstances outside your control, build an emergency fund so you have cash reserves to tap for unplanned bills. And if the reason for your existing debt has nothing to do with emergencies, it may be time to get rid of your credit cards if you can't trust yourself to use them responsibly.