Caiaimage/Paul Bradbury/Getty Images

An emergency fund is an essential part of everyone’s financial plan. This is the money you should have earmarked for unexpected events, such as a medical bill, emergency room visit or unexpected hospitalization. Or, it could be your fund to live off in the event of unexpected unemployment.

The reasons for using an emergency fund are endless, so it’s critical to prepare and build an emergency fund to avoid letting unexpected expenses lead you to financial ruin.

“By nature, unplanned expenses are unexpected, so the sooner you’re prepared the better off you’ll be when the inevitable happens,” says Greg McBride, CFA, Bankrate’s chief financial analyst.

How to build an emergency fund

Starting an emergency fund can be as easy as splitting a portion of your direct deposit into a savings account or money market account. It can also consist of setting up a recurring transfer from your checking account into a savings or money market account each week, every other week or monthly.

In addition to splitting a portion of your direct deposit into an emergency savings account, tally up your expenses at the end of the month, McBride says, and compare that with your net income.

“If there’s a surplus, you now have a second bite at the savings apple,” McBride says. “You can move that surplus over into savings.”

Kevin Gallegos, vice president of Phoenix operations for Freedom Debt Relief, says to set your expectations at a realistic level.

“Any action you can take to establish an emergency fund will do you good,” Gallegos says. “If you transfer $10 to a savings account each week, you’ll have $500 in a year.”

If you are not sure where the funds for this emergency fund will come from, re-evaluate your spending habits and your budget.

Start with a small amount of savings each month, but try to increase it whenever possible. And anytime you get a tax refund or bonus, add it to your fund. And gradually boost your savings by selling items you don’t need, holding a yard sale or putting change into a jar every evening — anything to slowly accumulate cash.

“By stashing the extra, in addition to your regular predetermined amount from your budget, you’ll see your savings soar,” Gallegos says.

How much to save in your emergency fund

Make small goals at first, such as saving $1,000, and then work your way up to a reserve to cover several months’ worth of expenses. While your savings goal will depend on your income and expenses, a general rule of thumb is to save enough to cover three to six months’ worth of expenses.

Gallegos says that when setting your savings goal, you should focus on having enough to cover expenses, not on replacing your entire income.

“Remember, in an emergency, we don’t fund vacations, fancy new clothes, dining out or other luxuries,” Gallegos says.

Your emergency savings account should be able cover six months’ worth of expenses, McBride says. For a lot of people, accumulating that amount of emergency savings is going to take some time.

“That’s a destination, not a starting point,” McBride says. “… But the important thing is, if you’re saving consistently, you’re putting yourself on the pathway to get there eventually.”

A sole breadwinner, a business owner or a person with a highly variable income might want to aim for nine or 12 months’ worth of expenses in their emergency savings account, McBride says.

Where to keep your emergency fund

Your emergency fund should be easily accessible, but not so easily accessible that you’ll be tempted to make withdrawals for everyday spending.

Online banks are good locations for your emergency savings because you can’t just walk into the bank and withdraw your cash. Consider keeping emergency funds in a combination of locations, including an online savings account, money market account and short-term CDs. Online banks also typically offer higher yields than brick-and-mortar banks.

Try and determine how quickly you may need these funds in an emergency and how you would be able to transfer, withdraw or use these funds.

Since you might be forced to use an emergency savings account as a transactional account in an emergency, a money market account may be a great option – assuming the APY is competitive with the top savings accounts available. But there is nothing wrong with having your emergency funds in a savings account either, since there should be a way to get those funds into a transaction account if needed.