When I was in my late twenties in 2004, I got my dream job as a magazine editor.

The only problem was that my salary wasn’t enough to cover the astronomical expense of living in New York City, along with all of my graduate school student loan debt. That was especially true after my roommate moved out and I decided to live in my two-bedroom Brooklyn apartment on my own. I kept finding myself paying my rent later and later, taking full advantage of my landlord’s ten-day grace period.

Since I relied on credit to cover the gap between what I made and what I spent, my credit card bills also started creeping up each month. First a hundred dollars, then an extra three or four hundred dollars.

When my debt hit $8,000, I realized I needed financial help.

I thought I’d hit on the perfect solution: I’d cash in my 401(k), which I’d started contributing to at a previous job. I’d saved $10,000. It wasn’t a huge amount, but that was enough to make a big dent in my growing debts, and to give me a small cushion to cover future expenses so I wouldn’t keep falling back into debt.

When my debt hit $8,000, I realized I needed financial help.

I knew there would be penalties for cashing in my account, including a 10% penalty from the Internal Revenue Service, as well as state and local taxes. However, those seemed like a small price to pay for wiping out my credit card issues with one lump sum. It seemed especially worthwhile, since the interest on my credit cards was over 20%.

What I failed to consider were the long-term consequences of my decision, the biggest being that I was jeopardizing my retirement.

I may have only saved $10,000, but that amount would have grown if I’d kept contributing at the same rate, about 5% of my $40,000 salary, along with the market gains over the years. Today, I’d probably have about $100,000.

In retrospect, I realize I could have taken a loan from my 401(k) account, rather than cash it out, but that didn’t occur to me back then. I also could have gotten an interest-free loan from my family, or a 0% APR credit card to use temporarily, and pay back before the 0% rate ran out. (I also could also have cut back on expenses like eating out and going to concerts.)

But I was ashamed of being in such a dire situation, so I didn’t consult with a financial advisor or family members, who might have steered me in a different direction.

Worst of all, I told myself that my dip into my retirement account was temporary, and that I’d return to saving as soon as I was more financially stable. Well, it turns out that was an overly optimistic outlook. While I expected to simply take care of my credit card debts, then immediately resume retirement savings, once I stopped contributing, I kept finding reasons that I needed that 5%.

First, I got laid off from my magazine job and went on unemployment. Then I became a self-employed freelancer. When my rent increased by $100 each month, or the price of a Metrocard went up, or I simply wanted to go on vacation, instead of looking for ways to cut back on expenses, I told myself I could always restart my 401(k) later.

It wasn’t until I moved in with my boyfriend four years ago and realized that he’d been saving steadily since his twenties,  that it became clear how different our financial futures are.

Now that I’m in my forties, I’ve finally started contributing to a retirement account again. But I’m afraid it may be too little, too late. I’m currently putting $5,500 a year into an Individual Retirement Account (IRA), about 10% of my income, and the maximum amount I can contribute each year. I’m also hoping to increase my non-retirement savings starting next year.

If I hadn’t been so short-sighted, I wouldn’t have my bare bones retirement account looming over me

One big difference is that I’m now self-employed, so I no longer have an employer to match any of my contributions. Another is that rather than have my retirement savings automatically taken out of my paycheck, I have to be pro-active about setting that money aside, which is big challenge when you don’t have  regular paycheck.

There’s a reason there are financial penalties for cashing in your 401(k) early. The whole point of a retirement account is that it’s there to take care of you in the future. When you’re in your twenties, you can still find side gigs to bring in extra income, take on an extra roommate and cut back on spending. While you can work past your official retirement, well-paying jobs will likely be tougher to come by at that age when I’d be competing with people who are several decades younger.

Now that retirement is only twenty-five, not forty-five, years away, and I only have $11,000 saved, it’s gotten a lot more real in my mind—and a lot scarier to try to build up enough to live on in a much shorter period of time.

While half of Americans retire between 61 and 65, unless my income rises dramatically in the next two decades, I’ll likely be working well into my seventies in order to save enough.

If I hadn’t been so short-sighted, I wouldn’t have my bare bones retirement account looming over me. Making a rash decision about my money cost me a lot more, in savings and in peace of mind, than I ever expected.

So take it from me—if you’re considering cashing in your 401k early, don’t.