Whether you are just starting your career or you already see retirement on the horizon, there are many steps you can take to help ensure you will have enough assets for a comfortable lifestyle after you stop working.

And it’s never too early to start planning. A 2015 study by the Center for Retirement Research at Boston College found that 52 percent of all working households in 2013 were at risk for not having enough assets to maintain their pre-retirement standard of living, compared with 43 percent in 2004.

Although a shortfall in retirement income can be offset by spending less, saving more while you still are working is a smarter strategy.

Here are some ways to help you achieve your financial goals in retirement:

Save regularly — Save via direct deposit from your paycheck. Every dollar saved will help with expenses in retirement.

Put your pay raises to work — Each time you receive a raise, consider putting a portion into your retirement savings.

Avoid debt — You don’t want to enter retirement owing money for items such as car loans, vacations or credit card balances.

Work that 401(k) — If your employer offers a 401(k) or other retirement plan, contribute as much as you can afford or are allowed. If there is no employer plan, you can set up an Individual Retirement Account (IRA). If you are self-employed, you can contribute to a solo 401(k), SIMPLE IRA or a Simplified Employee Pension (SEP).

Consider working longer — The most recent figures from the U.S. Census Bureau show that women now age 65 have a life expectancy of 21.3 years; for men age 65, it’s 18.7 years. The longer you work, the fewer number of years you will need your retirement income.

Maximize retirement plan contributions — If you are 50 or older, you can contribute up to $24,000 to a 401(k) or similar deferred contribution plan in 2017, compared to $18,000 for those under age 50. For a SIMPLE plan, the limit in 2017 is $15,500, compared to $12,500 for those under age 50.

If you are ready to retire, you have other options and considerations, including:

Social Security benefits — If you have other adequate income, you can increase your eventual Social Security monthly income significantly by deferring the benefit until you are older. For example, according to information at socialsecurity.gov, if your full retirement age is 66 and two months and your monthly benefit at that age is $1,300, delaying to the maximum of age 70 increases your monthly benefit to $1,698 – an increase of 30.6 percent. In contrast, if you take Social Security early, at age 62, your monthly benefit is reduced to $964.

Phased retirement — If you choose to work part time as a transition to full retirement, there are limits on what you can earn if you receive Social Security benefits before you reach your full retirement age. If you exceed the limit, called the Earnings Test, some of your monthly benefits will be withheld. For 2017, the limit is $16,920.

Dave Isaacson is vice president-wealth portfolio manager for Johnson Financial Group.