It’s a scenario thousands of NYC homeowners experience each year. Perhaps it begins with a lost job or an illness. That quickly turns into a missed mortgage payment, and then a second. Homeowners find themselves in delinquency and in danger of foreclosure.

But often, they have options. About a dozen NYC nonprofit housing counseling and legal services agencies offer guidance and even legal representation. Counselors help homeowners save their homes, using loan modifications or settlements. They often notice when homeowners are victims of scams. The assistance limits the damage and helps homeowners work through a difficult process.

Across New York State, there were nearly 33,000 new foreclosure filings last year. Nearly 8,000 were in NYC, according to the Empire Justice Center, an Albany public interest law firm. Eight years after the financial collapse, foreclosure prevention remains a necessity. Even with a tentative recovery and improved home prices, many homeowners are still struggling and on the verge of losing their homes.

And the assistance to stop that trajectory is in jeopardy.

In the past, such services were paid for by the state. Recently, the state attorney general’s office used national mortgage settlement funds. But in September, that money will be gone. Gov. Andrew Cuomo has not included any funds in his initial 2018 budget to fill the gap. State officials should pony up the needed $10 million for the remainder of this fiscal year, and be prepared to put in $20 million for the following year.

If they don’t, the impact will be extensive.

In the short term, nonprofit agencies will stop taking cases. Come September, they’ll stop their foreclosure work altogether. People will be more likely to default and, ultimately, lose their homes, and neighborhoods will be hit by the economic domino effect — one that could hurt other homeowners, local businesses and more.

The foreclosure crisis will worsen unless state officials and lawmakers stem the tide.