Graphic shows a mix of flowers, money bags and dollar bills all growing on a vine. Title reads: Funding life changes

When you take a long car trip, you plan your route — when you’ll stop for gas and where you’ll pause for lunch. Even if you make the most detailed plan, though, you’ve got to prepare for unexpected: an accident on the highway, a road closure, or an extra pit stop. And that’s why you keep your phone charged with your favorite traffic app downloaded.

Planning your life’s finances is similar. No matter how comprehensive your financial strategy is (from your monthly budget to your retirement accounts), life has a way of throwing curveballs that can leave you in an uncertain position. Whether you originally intended to or not, you might find yourself looking to your investments, including your individual retirement accounts (IRA) or your 401(k), for money.

While it’s often advised to keep your investments in the market as long as you can, sometimes that’s simply not an option, whether due to an emergency like an illness or job loss, or a planned goal like buying a home. And that’s okay, because that’s what your money is for: to fund the ups and downs of your life in all stages.

Funding expenses with your regular investments.

Before you retire, you probably have several financial goals you hope to accomplish, like funding your children’s education or maybe treating yourself to a Mini Cooper. As you invest in the market, it’s important to keep these goals in mind, especially because your investment timeline will likely affect how you invest and what you invest in.

When things go according to plan and it comes time to sell stocks and other securities, you’ll want to consider several things. First of all: Plan to sell your investments ahead of when you will need the funds. For example, if you are using your investments to fund the down payment on a home, you probably will want to sell your investments when your loan is approved. You never know how the market as a whole or your holdings will perform — and while there’s a chance the value of your investments may go up if you wait, there’s also the possibility that they’ll fall, requiring you to sell more to generate the cash you need. It may also take time for the sale of your securities to settle, and to transfer the funds to your bank account.

Secondly, when tapping into your investments, it’s important to consider the tax implications you may face. You’ll want to speak with a tax professional to discuss any potential penalties and tax implications from withdrawals because, depending on how long you’ve held an asset, your capital gains may be subject to different tax rates, which could reduce your profits.

  • If you’ve held the security for more than a year, you’ll incur what is considered a long-term capital gain, which is generally taxed at a lower rate than ordinary federal income tax rates.
  • If you’ve held the security for less than a year, you’ll incur what is considered a short-term capital gain, which is generally taxed at ordinary federal income tax rates.

Finally, take a close look at the stocks you’re selling. While you probably invested in these specific securities in order to fund a certain goal or expense, you may still want to avoid liquidating ones with high growth potential (or sell them only once you’ve sold everything else) — otherwise you could miss out on significant gains in the future.

Although your non-retirement investments are likely focused on a specific goal, you may find that you have to tap them for unexpected reasons. For example, should you suddenly be furloughed from your job and unable to pay rent, you might sell the investments you originally intended to use towards a vacation. If so, you’ll still want to remember these three tips to maximize your original investment’s growth.

Using retirement funds for pre-retirement needs.

There are strict rules governing early withdrawals (or taking out money before you’re 59 ½ years old) from retirement accounts, so you’ll want to consult with a tax professional or your financial advisor to better understand any penalties you may face. In a perfect world, all the dollars you put into your IRA or 401(k) would grow uninterrupted until you begin taking distributions in retirement. But life isn’t perfect — and that’s why retirement accounts provide exceptions that let you take early distributions without penalty for certain planned and unplanned expenses.

The unexpected

Anyone can face a major unplanned expense — but even if you have an emergency fund or short-term investments, a serious illness, job loss, or unforeseen emergency could put you in a position where tapping into your IRA or 401(k) feels like the only option. The good news is that, depending on the situation, it’s possible to do so without penalty.

Many 401(k) plans allow you to take out a loan against your account balance. The dollar amount of such loans is limited to lesser of $50,000 or half of your account balance.

Like any loan, you will have to pay interest on your 401(k) loan — but instead of the interest payments going to a bank, they’ll be deposited back into your 401(k) account, where they’re treated as investment income.

In most circumstances, 401(k) loans typically have to be paid back within five years. There are certain exceptions to this rule, including using the funds to pay for your home (which must be your primary residence). If you lose or leave your job before paying back the loan, though, you will have to repay it in full by the federal tax return deadline.

You might also qualify for a hardship distribution, which allows you to withdraw funds penalty-free for what the IRS describes as “an immediate and heavy financial need.” Medical expenses, education fees or tuition, funeral expenses, and home repairs due to things like floods or fires are examples of situations that typically qualify.

Keep in mind: Due to the COVID-19 pandemic, on March 27, 2020, the United States passed a stimulus package called the CARES Act (Coronavirus Aid, Relief, and Economic Security Act). Part of this bill allows Americans to withdraw up to $100,000 from their 401(k) or IRA without the 10% penalty in 2020 for certain expenses and financial setbacks related to the pandemic. Withdrawals that are paid back within three years may avoid taxes as well. And while the CARES Act is in place, 401(k) loan limits will also increase from $50,000 to $100,000.

Pro Tip: Because Ally Invest does not offer tax advice, make sure to consult with a tax professional and/or your financial planner to make sure you understand all of the benefits and drawbacks of withdrawing money from your retirement accounts in times of need.

The expected

Not all exceptions for early distribution are based on emergency situations. Other circumstances like home buying or funding education may qualify for penalty-free withdrawals as well.

While a 20% down payment isn’t a necessity for your first home (an undoubtedly exciting purchase), you may still want to make one in order to avoid private mortgage insurance (or PMI) and have lower interest payments. For some, tapping into your IRA may be a possibility.

Qualified first-time home buyers are eligible to withdraw up to $10,000 from a Traditional IRA. While you will have to pay income tax on those distributions, there won’t be a penalty.

If you have a Roth IRA (which means your contributions are made after tax), you can withdraw the funds you’ve contributed at any time penalty-free, even if you’re younger than 59 ½. You may also withdraw up to $10,000 of earnings from your Roth IRA for a first-time home purchase with no penalty and tax-free as long as you’ve been contributing to the account for at least five years. If you’ve had the account for less than five years, you may be able to withdraw the same amount for a home, but it will be subject to taxation.

No matter where life takes you, the journey often has twists and turns that you didn’t expect. So, it’s important to be flexible. Your ideal scenario probably doesn’t involve using your investments to get through an unexpected life change, but it’s important to know you have that option should you have an unexpected bump in the road.

Explore your investment options with Ally Invest.