When faced with two big financial priorities, such as paying off old debt and saving for retirement, it can be easier to focus on just one. For people repaying student loans for themselves or their children, for example, 38% weren't able to put money away for retirement, according to a 2015 survey from the National Foundation for Credit Counseling and NerdWallet. But there are ways you can contribute to retirement savings even while paying off student or other debt.

Neglecting either one can be a losing proposition. If you focus just on repaying debts, you can lose out on potential investment returns from money placed in a retirement account. On the other hand, you don't want to pay more interest on debt than you need to. So here are a some steps to help you save while reducing what you owe.

Step 1: Pay at least the minimum on debts consistently

Missing a loan or credit card payment can cost you in extra interest, fees and a dip in your credit score, so make sure to pay at least the minimum required amount each month to avoid this. That said, don't go overboard in paying at this point. If you rush to erase the debt as fast as you can, you might miss out on potential long-term gains from investing your money now.

Step 2: Save in a 401(k) up to any match, or set up an alternative

If your employer offers a 401(k) or similar retirement savings plan and will match part of your contributions, put in at least enough to gain the maximum matching amount. Also see how you can invest the money. For example, $10,000 invested to produce  an 8% annual return — the average over the past decade for the Standard & Poor's 500 Index of large U.S. stocks — would grow to more than $100,000 over 30 years. If you're young enough, you can let your money compound for decades.

If you don't have access to a 401(k), consider setting up a Roth IRA. The annual maximum you can put in is $5,500, or $6,500 if you're 50 or older. A Roth IRA lets your money grow tax-free.

Step 3: Focus on paying off debt

Once you have started setting aside some money for retirement, you can turn your attention back to reducing your loans or credit card balances. By paying off more than the minimum each month, you eliminate your debts faster and cut the interest you end up paying.

As you manage these two goals, remember to build an emergency fund as well, so that you have ready cash to cover unanticipated expenses. If you don't, you might end up back in debt or draining your savings.

By following these steps, you can avoid having to choose between your retirement goals and paying off debt. Taking advantage of the opportunity to save money now and to reduce debt can help you improve your financial life for years to come.

© Copyright 2016 NerdWallet, Inc. All Rights Reserved

Related Post: Gain Peace of Mind by Consolidating Debt W