Contributing as much money as possible to retirement savings is essential -- especially with so many people having too little saved for the future.

But while you need to invest for your later years, you may not want to devote all your spare cash to this goal if you haven't checked a few other items off your to-do list first. In particular, there's two tasks you may want to undertake before you max out your retirement accounts. 

Tipped over 401(k) jar full of coins.

Image source: Getty Images.

1. Pay off high-interest consumer debt

If you have high-interest debt, chances are good you're paying far more in interest to your creditors than you could reasonably expect to earn by investing. Your interest costs will also eat up the cash available to you, making it harder for you to invest what you need to retire comfortably. 

It's best to take care of this debt ASAP so you don't have this obligation hanging over your head and so you don't continue wasting money on interest. Rather than maxing out your retirement accounts, contribute only enough to your 401(k) to get the employer match and then devote every extra dollar to getting rid of the debt you owe. 

You should do this only if you're serious about getting out of debt and staying out of debt. Once you're done with paying off your creditors, reallocate some of the money you were sending them to shoring up your retirement account balances. 

2. Save up an emergency fund

If you're living paycheck to paycheck without any savings, you could find yourself making difficult choices when unexpected expenses come up. You could be forced to borrow and find yourself with high-interest consumer debt you have to pay back. Or you could end up pulling money out of your retirement accounts to cover the emergency costs, which could lead to penalties and taxes

You don't want to lock up all of your money in a retirement account that you can't easily make withdrawals from if you don't have an emergency account to rely on when something goes wrong. So, again, contribute enough to get your employer match and put any additional spare cash into an emergency fund.

Once you have enough saved to cover several months of living expenses -- around three to six months is advised by most experts -- you can get more serious about trying to max out your retirement savings accounts with your extra funds. 

Be smart about how you allocate your assets

If you're like most people, you have only a limited amount of spare cash -- so making smart choices about what to do with it is essential.

You definitely want to contribute enough to your 401(k) to get the full employee match. But beyond that, if you don't have an emergency fund or if you're in a lot of debt, devoting some of your money to these goals just makes sense rather than maxing out your retirement plans.

Once you have paid down your debt and have cash saved for emergencies, you can redirect the extra money toward supercharging your savings -- and you'll be in a much better financial position as you save for the future.