No budget is complete without a plan to deal with the unexpected, which means you need to build up an emergency fund. It may take a little bit of discipline while you’re in savings mode, but the relief you experience from knowing that you have the financial means to handle whatever life throws at you — whether the loss of a job or unexpected car repairs — is priceless.

Planning for the unexpected helps you sleep easier.

Prepare for the Worst

When you’re budgeting for a contingency fund, prepare for the worst and you’ll have the peace of mind of knowing that you’re prepared. “I think what people forget about contingencies is that when it rains, it pours,” says Michael Solari, a certified financial planner practicing in Bedford, New Hampshire. “If you’re a homeowner, things can run the gamut from replacing a small appliance to replacing an entire roof. It’s always important to set aside enough to be prepared for pouring rain.” As a result, Solari recommends having three to six months’ worth of expenses. If you’re married and have two incomes and stable jobs, you can be on the lower end, but if you’re single and don’t have great job security, you need to save more.

Fitting Savings Into Your Budget

There’s no one-size-fits-all answer to how much or what percentage of your budget you should be putting toward your contingency funds. The short answer is to divide the amount you need to save by the amount of time you’re willing to wait until you have your goal met. For example, if you want to save $9,000 in 24 months, you need to put aside $375 each month. “It’s important to look at your budget and see where your money is going,” says Solari. “It’s tough to say that you should stop contributing to your 401(k) and put this money into a savings account. Sometimes that may be the answer and sometimes it isn’t. It all depends on each individual’s unique situation.”

Keep Separate But Accessible

Your emergency fund should be kept separately from your other money, but not somewhere where you could lose money or that you couldn’t access it in case of emergency. “Keep the rainy day fund in a savings account,” recommends Solari. “When you need it, you need it quickly. It is not something you should be putting in an illiquid account or something that carries risk. In today’s interest rate environment, it may seem like you should be putting it in an account that could get a better return. In reality though, the more return you want, the more risk you’ll have to take. The last place you want to be is pulling money out when you’ve lost principal or when it’s locked up in something like a CD.”

Motivate Yourself

Everyone is motivated in different ways, so you need to find the motivation that works for you. For some people, the stress relief of knowing you won’t have to turn to high-interest credit cards when times get tight is enough. But, if you do better with positive motivation, consider making plans for how you can spend your monthly savings after you’ve met your goal. To stay focused, you can reward yourself as you progress toward your savings goal. For example, treat yourself to an extra dinner out when you’ve funded 20 percent of your emergency fund. In addition, consider automating your savings. When the money gets transferred automatically, you’re less tempted to skip a month here and there.