You’ve been responsible with money your entire life, setting some aside for retirement or to build up a rainy day fund. Then something unexpected comes up—a long stretch of unemployment, an illness with major medical bills, or major unanticipated home repairs—and you suddenly find your savings depleted.

I’ve worked with clients who have gone through some of life’s worst struggles, including:

  • Losing a great paying job only to replace it with one that doesn’t even pay half of the previous wage.
  • Losing a spouse, the primary breadwinner, unexpectedly and becoming the financial leader of the household.
  • Encountering an unexpected illness, racking up huge hospital bills, and completely wiping out all savings, making retirement almost a pipe dream.

These types of emergency situations can leave your finances crippled, and you may find yourself asking, “How do I start over?”

The first thing to get out of the way is what most people already suspect, deep down: there’s no quick fix to the problem. It probably took you years, or even decades, to build your savings in the first place. It’s likely to be a long, slow process to rebuild them. By accepting the fact that there’s no easy solution, you can move on with what needs to be done.

Set a budget and reduce your expenses

There are some things you can do to ease this difficult process, like setting a budget and lowering your expenses. The less you need to spend, the more you will have to put in your savings.

Get debt under control. Ongoing debt can bleed you dry and make it impossible to put money aside. By retiring debt, you will save money over the long haul. If you have ongoing credit card debt, for instance, the very first thing you should do is pay it off as soon as possible. Interest payments on credit card debt of 25 percent or more could be adding hundreds of dollars a month in expenses.

If you have a mortgage, by all means look into refinancing. Rates have never been this low, and you could realize hundreds of dollars in monthly savings by refinancing.

Rebuild your savings

Once debt has been brought under control, you can begin setting money aside again.

Virtually all personal financial consultants recommend immediately creating an emergency fund that is equal to three to six months of expenses, to be placed in a safe place, such as a short-term certificate of deposit or an interest-bearing savings account. The returns are pitiful these days, but the idea here is to have money that can be retrieved easily if an emergency crops up but not so readily accessible that you’ll be tempted to dip into it for non-emergency spending.

Begin contributing to a 401(k) or IRA as soon as possible. 401(k) contributions are often matched by employers, which can double your rate of savings. Both 401(k) and IRA contributions bring tax benefits, so you’ll have more money to save overall.

Make contributing to your savings a top-priority expense:

  • Pay yourself first by immediately putting a set amount of money aside from each paycheck rather than waiting until the end of the month to see how much is left over. Treat saving as a predictable monthly expense, like food and utilities.
  • If possible, have some money automatically deducted from each paycheck and placed into your savings account.
  • Immediately place any financial windfall—a bonus or a rebate, for example—into your savings.

Rebuilding your savings after having them completely depleted isn’t easy, but with discipline and the right attitude, it can be done.

Jeff Rose is a certified financial planner and author of the blogs Good Financial Cents and Soldier of Finance.  Learn more about his Roth IRA Movement that has inspired over 140 personal finance advisors to educate young adults on the importance of saving.