In a time of stress in public budgets, from Washington on down, no one can expect that the belt-tightening will be painless.

For all the complaints about government spending, it doesn’t all go to high-paid office staff and mohair subsidies. Much of it goes to valuable services that meet real public needs, such as providing volunteer advocates for neglected and abused children or helping child care centers work with preschool kids who have severe behavioral problems.

Few Americans, we suspect, would quibble with the intention of these programs or argue that they aren’t worth spending some taxpayer dollars. But both are facing extinction next year as they lose public funding that made up much of their budgets.

Both programs have been active in Western New York. The Mental Health Association of Erie County was notified earlier this month that it will lose an annual $60,000 grant from the state’s Unified Court System for Court Appointed Special Advocates for Children, or CASA.

The money paid for two staff members who coordinated volunteers assigned to help foster children in Family Court. Officials said the funding for CASA was eliminated statewide because of budget problems in the Unified Court System.

The other program, which has been coordinated by the United Way, will lose $98,192 from Erie County next year because state money that helped pay for it is needed to help poor parents pay for child care. Such are the risks of relying on government funding during a time of economic weakness.

Still, it is hard to believe that these cuts were handled in the best possible way. Even if you accept that spending has to be reduced and that real people will pay a price for that, government should avoid, as much as possible, abruptly pulling the rug out from under those who depend upon the programs that it helps to fund.

That’s what New York State tried to do to Roswell Park Cancer Institute earlier this year. Even though it originally gave the Buffalo hospital two years to find sources of money to replace tens of millions of dollars in state funding, it was the equivalent of pulling the rug for an entity as large, complex and valuable as Roswell Park. State officials thought better of the plan and have given the hospital more time to plan for a future without state funding.

That needs to be the standard as Washington, Albany, counties and municipalities struggle to cope with diminished funding and rising costs.

It may not always be possible to reduce funding over a period of time to allow agencies to find other sources of money, but, knowing that people will suffer under unilateral funding cuts, it needs to be the goal.

In the meantime, supporters of these programs should be looking for other sources of money to maintain these programs as best as possible. Foundations and other donors may be able at least to offer bridge funding while leaders of the programs search for a permanent solution.