Retirement is hard work these days. How do you generate enough income in a world where the S&P 500 yields roughly 2% and 10-year Treasury notes offer 2½%? Here’s my five-step plan:

1. Delay Social Security.

Suppose you retire at age 65, at which point you’re eligible for $20,000 a year in Social Security retirement benefits. If you put off benefits until age 70, you would miss out on five years of benefits worth $100,000. In the meantime, you’d likely have to cover your living expenses entirely out of savings.

Still, delaying could make sense. You would boost your benefit at age 70 to at least $28,300, or 41% more, ignoring increases for inflation. A simplistic calculation suggests the extra $8,300 a year would compensate for the missed $100,000 if you live until 82. If you assume the missed $100,000 earned a positive return, even after subtracting inflation and taxes, that raises the break-even age somewhat.

But remember, the life expectancy for a 65-year-old man is age 84 and for a woman it’s 87, and half will live longer than these averages. Delaying can be a particularly smart move if you’re married and you were the main breadwinner. Not only will you get a fatter monthly check for life, but also your spouse could receive your benefit as a survivor benefit. Because of that survivor benefit, it may make sense to delay benefits, even if you’re in poor health.

2. Cover your fixed costs.

Add up how much you spend each month on costs that are pretty much unavoidable, such as mortgage or rent, income and property taxes, car expenses, groceries, utilities and insurance premiums. If you can cover these fixed costs with Social Security, any pension income, interest and dividends, you’re in great shape, because you know you can pay for the basics, no matter how crazy the financial markets get.

What if you can’t cover your fixed costs with regular income? If you’re a conservative investor, you might boost your monthly income by using part of your savings to buy an immediate-fixed annuity. This involves handing over a chunk of money to an insurance company. But in return, you can get a generous income stream that’s paid no matter how long you live.

3. Build a cash cushion.

In addition to fixed costs, you’ll have various discretionary expenses. This is the fun stuff, things like eating out, going to the theater and traveling to Europe.

Figure out your total monthly spending—both fixed and discretionary—and compare this to your regular income from Social Security and elsewhere. Let’s say the gap is $10,000 a year. This money will need to come from selling investments.

Problem is, when it comes time to sell, your stocks and bonds could be in a deep funk. As a precaution, you might stash five years of portfolio withdrawals—which, in our example, would be $50,000—in certificates of deposit and short-term bonds. Thanks to this cash cushion, you know that, no matter what happens in the markets over the next five years, you’ll have the spending money you need.

One warning: Financial experts often recommend retirees pull 4% from their portfolios in the first year of retirement and thereafter step up their withdrawals with inflation. This 4% includes all money you take from your portfolio during the year, including dividends, interest and investment sales. Withdrawing more than that sum? You could run out of money if you live to a ripe old age.

4. Go for growth.

Because you have your fixed and discretionary costs covered for at least the next five years, that frees you up to invest the rest of your portfolio more aggressively. You might buy a mix of stocks and riskier bonds. In good years for the financial markets, sell some winners and use the proceeds to replenish your cash cushion. In bad markets, sit tight.

5. Manage your spending.

If inflation remains muted and the markets are kind, you should be fine with a 4% withdrawal rate.

What if the markets aren’t so kind or inflation takes off? What if you spent more than you should last year, because you sprang for an expensive cruise? You might use a key financial lever: your ability to vary your spending. To get your finances back on track, reduce discretionary spending for the next 12 months. You can’t control how the markets perform—but you can control your spending.