Money — or rather the lack of it — keeps many Americans up at night. Specifically, many people lose sleep over unexpected expenses, according to research by the American Psychological Association.

Other research confirms what is intuitive: people who don’t have an emergency fund to help meet such expenses are much more stressed than those who do.

Establishing an emergency savings reserve is crucial to maintaining financial stability. Indeed, building a reliable reserve should take precedence over your investing. Otherwise, you may find yourself forced to liquidate investments to meet short-term emergency needs. That will have negative tax implications if the investments must be sold from a tax-advantaged account. Worse yet, you could be forced to sell at an inopportune time — i.e., when prices have fallen.

So having a savings reserve isn’t just a stress reducer. It’s a critical element of a long-term money-management strategy.

How much should you save?

Financial planners typically suggest maintaining an emergency reserve sufficient to cover three to six months’ worth of “essential living expenses.” Let’s see what it would take to cover expenses for those lengths of time.

According to the U.S. Census Bureau, the median before-tax income for a married couple with children under 18 is $93,654. The figure we’re interested in, however, is after-tax income. Here’s why: one of the emergencies a savings reserve helps cover is a temporary loss of income. In such a situation, you won’t need to replace all of your lost income because a certain percentage went to taxes (which you won’t have to pay if you’re not working.)

Therefore, from the median gross of $93,654, we’ll subtract an estimated 17% for income and payroll (i.e., Social Security/Medicare) taxes. The result is $77,732, which translates to a need of just under $6,500 per month.

In broad-brush terms, you probably could cover your essentials with about 75% of after-tax income because certain expenses could be reduced or put on hold during a loss-of-income situation: entertainment, vacations, retirement-account contributions, etc. So a three-month savings reserve for our median-income family would amount to approximately $14,625 ($6,500 x .75 x 3). A six-month reserve would be double that: $29,250.

The table on the right shows the target amounts for three- and six-month savings reserves at various income levels. (Ideally, it’s better to prepare for longer than three months.) You may want to go higher than these targets, but be wary of going much lower.

To some degree, the target size of your savings reserve will depend on how many “breakable” moving parts your life has. A single person who rents an apartment and has a secure job will need to set aside less than a married person who has children, owns a home, and is subject to layoffs.

Note: For the table, we rounded some numbers and used a uniform estimate of 17% for the amount of gross earnings paid in income and payroll taxes. Those with lower incomes should use a smaller percentage; those with higher incomes a larger percentage. (Effective tax rates vary, depending on income level, deductions, employment situation, and state of residence.)

Where to find the money

Right about now, you may be feeling like a particular character (played by comedian Steve Martin) in a classic Saturday Night Live skit. Sitting at a kitchen table with his wife, listening to an infomercial announcer talk about avoiding debt by having a savings reserve, he inquires, “And where would we get this ‘saved money’?”

One source for “jump-starting” an emergency fund is a tax refund. About 80% of taxpayers get a federal refund each year, and the average amount tops $3,000. If you’re getting a refund this year, commit to putting it into a savings account. Also have your withholding adjusted so that less is withheld from your paychecks. Use the added take-home pay to grow your emergency fund month after month. (To estimate how much you should have withheld, use the IRS’s online withholding estimator.)

Important: Your emergency fund isn’t for getting new tires or an annual furnace check-up. Those items should be covered by budgeting each month for vehicle maintenance and home upkeep. An emergency fund is for just that — emergencies. As noted earlier, the most significant financial emergency for most people is a loss of income — something that can occur without warning, as the sudden economic impact of the coronavirus has demonstrated all too painfully.

Keep it accessible

It’s best to keep your savings reserve where it can earn at least a little interest while remaining easily accessible. You don’t want to tie up your emergency savings in a multi-month CD or any other asset you can’t turn into cash right away.

One of the best holding places for emergency savings is an online-only bank. Such banks are FDIC-insured and pay higher interest rates than local “brick-and-mortar” banks.

By helping protect you during the financial storms of life, a well-funded emergency reserve will go a long way toward guarding your overall financial health. Knowing such a fund is there may even help you get a good night’s sleep.