Being in debt can compromise your financial security, as paying interest eats up cash you need to make a workable budget, cover living expenses, and accomplish financial goals. It's something to be avoided, and you'll likely want to address it ASAP if you're already in debt. 

But for far too many American families, becoming and staying debt free can seem impossible. Whether you find yourself struggling to get out of debt or struggling to stay out of it, borrowing often feels like it's an inevitability. And indeed, this is the case for the majority of us. Unless we have one key thing: an emergency fund. Here's why it's essential to staying out of debt. 

Stack of past due bills

Image source: Getty Images.

You can't stay debt-free without an emergency fund

According to recent research from the National Endowment for Financial Education, close to four in 10 working adults in the United States are financially fragile. This is defined as not being able to come up with $2,000 in 30 days to cover an unexpected expense. It's not just low-income households that would struggle to come up with this much cash, either. Almost 30% of middle-income households and 20% of households with incomes between $75,000 and $100,000 would be unable to cover a $2,000 surprise expense. 

And there are lots of reasons you might need to come up with this much money quickly. Replacing a transmission in your car, for example, costs an average of around $1,800 to $3,400. An overnight stay in a hospital in the U.S. could cost an average of $1,889 to $2,488 depending whether you're at a state-run facility, a nonprofit hospital, or a for-profit hospital. 

These are just two examples of situations where you may incur significant unexpected expenses you need to pay immediately. Without an emergency fund, when you face a surprise cost you can't avoid, you'd have no choice but to borrow to pay it. And depending on what type of access to credit you have, this could mean taking on high-interest consumer debt such as using a credit card debt or even a payday loan. 

When you have money in a savings account for emergencies, you won't have to worry about putting more money on credit cards you've been working hard on paying down or that you've just managed to pay off. Then, work on building your emergency fund back up before going back to paying extra toward your debt or other goals. 

How much should you have in an emergency fund?

Saving up three to six months of living expenses should ultimately be your goal as this will ensure that even a major catastrophe such as a job loss doesn't end up forcing you to borrow.

But if you already owe money and don't want to spend many months or years building up a big emergency fund before focusing on aggressive debt repayment, it's a good idea to save at least a mini emergency fund of anywhere from $500 to $2,000. 

The size of your fund should be reflective of your income and obligations. If you have a higher income, it won't take you as long to save up a $2,000 emergency fund -- and this larger amount will likely be necessary because you probably have higher expenses commensurate with your higher income. If you have lots of family obligations or face a high risk of emergencies, you should also err on the side of a larger emergency fund, even if you're trying to pay down debt.

Expect the unexpected

Start building your emergency fund today to make sure you're prepared when the worst inevitably happens -- so your next surprise doesn't lead you into more debt.