When you're leaving a job, it's only natural to want to take your 401(k) funds with you. It's your money, after all, and leaving it behind can have unpleasant consequences. Your savings might not grow quickly due to high fees, or you could forget about the account altogether.

It might seem simplest to cash out the account and deposit it elsewhere, but there's a major problem with this approach. Here's what you need to know when transferring your 401(k) funds.

Stressed person looking at laptop.

Image source: Getty Images.

What's wrong with cashing out your 401(k)?

The government considers cash you withdraw from your 401(k) to be a distribution, so you'll probably pay taxes on it. And you'll also owe a 10% early withdrawal penalty if you're younger than 59 1/2 at the time.

You can get around the taxes and penalties by depositing the withdrawal into a new IRA or 401(k) in your name within 60 days. This is known as an indirect rollover, but there's a catch.

When you cash out your old 401(k), the plan administrator automatically withholds 20% of your balance for taxes. But you have to deposit the full balance of your old 401(k) into your new account to avoid the taxes and penalties. That means you need extra cash on hand to make up the difference and complete the indirect rollover.

If you can do it, you'll get the amount the plan administrator withheld from you at tax time. If you're not able to deposit an amount equal to your old 401(k) balance into your new account, the government considers the missing amount to be a distribution.

How do you transfer your old 401(k) funds without the risk?

Those who'd rather not risk the taxes and penalties associated with indirect rollovers are better off doing a direct rollover. This is where you tell your old 401(k) plan administrator where you want your funds sent, and it transfers them for you. There's often a one-time fee for this service that comes out of your account balance.

If you don't already have an IRA or a new 401(k) to send the funds to, you'll have to set one up first. If you plan to move your money to your new employer's 401(k), remember to check if it allows transfers from another 401(k) plan. Then, reach out to your previous plan administrator to find out what you have to do next. You may also want to inquire about how long the transfer will take and then verify that the funds make it to your new account.

Once the money is in your new account, you'll have to decide how to invest it too.

The whole process doesn't take too much time, and it's definitely worth the effort. Your savings will continue to grow, and you'll have fewer accounts you need to manage. You don't have to do this the second you leave a job, but try to find time for this process in your first few months so you don't forget about your hard-earned savings.