Recently paid off those lingering credit card balances? Finally made your last payment on your student loans? Perhaps you’ve recently opened a credit card but aren’t sure how to stay out of debt while using it to build your credit history.

Financial advice often stresses the importance of spending less than you earn — but it doesn’t always explain how to stay out of debt in the long-run.

Here are six habits anyone can apply to their financial life to help stay debt-free.

1. Manage credit card balances based on cash on hand.

Credit cards may be synonymous with the phrase “buy now, pay later” but it pays to make sure you have the cash on hand that you could theoretically use to make a purchase before you put it on plastic.

This strategy empowers you to enjoy the benefits of credit cards (including the potential to earn rewards, including cash back on purchases) while ensuring you won’t be faced with a credit card balance you can’t pay in full.

2. Monitor spending with a self-imposed credit limit.

The amount of your credit line you use compared to the amount of credit available (called the credit utilization ratio) is an important factor in your credit score calculation.

There is no specific ratio that causes a person’s credit score to drop, but it’s a good idea to keep your credit use relatively low. Aside from the positive impact this could have on your credit score, it forces you to stay aware of your credit card balance, and to be mindful about spending.

3. Limit housing expenses.

A 2016 analysis by the Joint Center for Housing Studies of Harvard University indicates that an increasing number of Americans technically qualify as “severely cost-burdened,” defined by monthly housing expenses that account for at least half of their monthly take-home pay.

When living expenses take up at least half of a person’s paycheck, the researchers explain, they are often forced to make financial sacrifices in areas like health care and retirement savings, and are more likely to fall into debt.

Consumers collectively paid their financial institutions more than $11 billion in overdraft and non-sufficient funds fees in 2015, reports the Consumer Financial Protection Bureau.

4. Pay yourself first.

More than half of Americans don’t have $500 saved to cover an emergency expense. A basic premise behind how to stay out of debt is having savings you can rely on if you’re faced with an unexpected expense. At minimum, experts recommend you build an emergency savings fund that could cover three to six months of basic expenses (and, potentially, as much as one year’s worth depending on your level of job security).

Make automatic contributions to a savings account earmarked for emergencies from every paycheck, even if you can only afford to save a little bit of cash at a time.

5. Make it your mission to avoid unnecessary fees.

Consumers collectively paid their financial institutions more than $11 billion in overdraft and non-sufficient funds fees in 2015, reports the Consumer Financial Protection Bureau. Further, a survey revealed that the most common credit card fees include those for late payments, cash advances, returned payments and balance transfers.

Be sure to read the cardholder agreement and terms and conditions for your financial accounts so you’re aware of the fees associated with them. For example, many credit cards offer a grace period on new purchases; you could avoid paying finance charges when you pay the balance for that statement in full by the payment due date.

Credit card balances associated with balance transfers and cash advances may not offer a grace period, and could include additional transaction fees. If you don’t understand the potential fees associated with different financial transactions, contact your bank or credit card issuer and ask before you take action.

6. Don’t give your budget a raise.

The challenge of how to stay out of debt isn’t associated with your income so much as it is your ability to avoid spending more, once your earning power increases. Got a raise, bonus, tax refund or cost of living increase? Put it directly into an account that pays interest; it may help you grow the value of your cash.

Not only does this strategy help you work toward financial goals beyond how to stay out of debt, but also by limiting your expenses, you increase the likelihood that you will remain debt-free for life.

Legal Disclaimer: This site is for educational purposes and is not a substitute for professional advice. The material on this site is not intended to provide legal, investment, or financial advice and does not indicate the availability of any Discover product or service. It does not guarantee that Discover offers or endorses a product or service. For specific advice about your unique circumstances, you may wish to consult a qualified professional.