Despite having some shortcomings, employer-sponsored 401(k) accounts can be extremely useful in helping you save for retirement. Yet too many people end up taking money they should earmark for their financial future and using it for immediate gratification, leaving themselves that much further behind in building a secure nest egg.

401(k) withdrawals don't have to be a bad thing. But to avoid unfortunate consequences, you have to be smart about it. Below, you'll find several tips on when moving money out of your employer-sponsored retirement account is smart versus when it's a big mistake.

A definite no-no: Blowing it in one fell swoop
One opportunity that many workers goof up occurs when they switch jobs. Especially if you haven't been at a job for very long and your retirement plan balance isn't very big, it's tempting to look at that money as a nice windfall to let you splurge for a little while before starting up with another job.

But withdrawing your 401(k) money and simply spending it doesn't just deplete your retirement savings; it also exposes you to unnecessary taxes and penalties. Every dollar that you take out of a traditional retirement plan gets added to your taxable income on your tax return and in turn increases your eventual tax liability when you file with the IRS the following April. Even worse, unless you're at least age 59 1/2, you'll end up paying an additional 10% penalty on top of the tax hit from your withdrawal.

A little better: Using money for certain expenses
Not all 401(k) withdrawals are subject to the 10% penalty. For instance, if you have major medical expenses that amount to more than 7.5% of your adjusted gross income, then the IRS lets you take money out of your 401(k) to pay those expenses without penalty. Similarly, if you are totally and permanently disabled, you don't have to pay the extra 10% on the money you pull out.

Even without the penalty, though, using 401(k) assets still forces you to pay income tax on the amount you take out. In addition, once the money's out, you're not allowed to redeposit the money back into your retirement account unless you're eligible as a current employee at a company that offers a 401(k) plan.

The smart choice: Rolling it over
The one case where taking money out of your 401(k) account makes sense is when you're eligible to transfer or roll it over to an IRA. That usually happens when you switch jobs.

The best way to move money is to do a direct transfer, where your money goes directly from your employer to the financial institution you choose to set up your IRA. That way, you're assured there won't be any tax or penalties assessed. If you get a check from your employer, things get a little more complicated. You can still do a rollover, but you have to redeposit the full amount of your 401(k) balance into an IRA within 60 days. Moreover, if your employer withheld taxes from the check you received, you need to make up the difference out of your own funds before the 60-day period expires. Otherwise, whatever part you don't put in an IRA will be charged penalties and be added to your taxable income.

Best of all: When you retire
Obviously, the best time to use your retirement money is once you're retired. Transferring to an IRA at that point gives you a lot of investing flexibility, letting you choose income-producing investments that will let you withdraw income while leaving principal intact if you so choose.

Traditionally, bonds paid enough in interest that you could use a 401(k) bond fund for your income needs. Nowadays, most bonds don't yield much, but many stocks have attractive dividends. Among the blue chip stocks in the Dow, for instance, AT&T (T 1.88%), Verizon (VZ -0.53%), and Intel (INTC 0.64%) all have yields of 4% or more. Most 401(k)s won't let you invest in those stocks, but a rollover IRA will.

Don't cheat your retirement
When money's tight, a nice chunk of change in a retirement account may seem like an easy thing to plunder. In the long run, though, you'll be far better off leaving your 401(k) alone and taking smart steps to preserve, nurture, and grow that money well into the future.