In early and middle 1971, Richard M. Nixon was moving to fight inflation by holding federal spending in check. Then he panicked.

Economic growth was low, unemployment was high, and the next presidential election was only a year and a half away.

With a simmering international monetary crisis as an excuse, Republican Nixon slapped on wage and price controls that left him free to pump up the economy with small fear of inflation.

Now, Democrat Jimmy Carter is in a comparable position, facing high inflation and 6 percent unemployment at the same time. He, too, is saying that he intends to fight inflation by restraining spending; that will be the theme of the budget he sends to Congress tomorrow.

Washington's cynics smile at this. They think Carter eventually will cave in, just as Nixon and most other U.S. presidents have. As the election approaches, they expect Carter to start spreading new federal largess.

But this time the cynics may be wrong. New political and economic realities have forced Carter to a corner. Inflation is far higher than it was in 1971, and the economy, despite a similar unemployment rate, is closer to overheating. And today there is a broad public disenchantment with government spending and high taxes that was absent eight years ago.

Carter and many other Democrats have come to perceive that there may be at least as many votes in fighting inflation as in attacking unemployment.

And, ironically, Carter, because he is a Democrat, may be in a stronger position to hold out for restrictive anti-inflation policies than Nixon was as a Republican.

Says House Speaker Thomas P. (Tip) O'Neill Jr., "Can you reelect the president on austerity? Where you gonna go for comparison?... I think Ronald Reagan will be opposing Jimmy Carter."

With all these things in mind, key administration officials say it would take a full-blown recession to cause Carter to abandon his new image as an inflation-fighting fiscal conservative. Perhaps surprisingly, a number of administration critics agree.

"There is no chance of a change" in Carter's budget policy later this year, says one top aide. "I've talked to the president about it and he knows he cannot be perceived as backing down on this issue. I cannot conjure up a situation, from all the economic indicators I've seen, that would cause him to relent.

"He's so entwined in this now, he cannot change direction."

Vice President Mondale, usually a voice for liberal programs within the administration, now argues: "I think we have to stay the course. There is really no alternative to getting this inflation rate down."

Nor does Mondale see any serious political risk, even in cuts in social programs Carter intends. "If we can demonstrate as we go into the election... that we have the ability to deal with inflation in a humane way, without the appalling costs of a major recession, I believe that will be the fundamental advantage in that campaign."

Other administration officials echo such assessments of the Carter resolve.Because of that resolve, and because Congress has sensed the same public mood about spending and taxes, some special-interest groups hit by cuts in the budget likely will have a tougher time than usual defending their programs. Presidential aides are confident, for instance, that if Carter were to veto any legislation this year as "inflationary" there would be virtually no chance of the veto being overridden.

Nevertheless, Carter might have to use the veto. Whatever the political attractions of austerity, O'Neill does not plan to sit still for too much of it.

"I'm not going to allow people to go to bed hungry for an austerity program... no way," O'Neill warns. "If unemployment goes up to 6.5 and I hear nothing from the White House, I'll be calling the [Democratic] Policy Committee to come forward with our own economic stimulus program and have a public works program of our own and we'll put it on his desk."

Despite the obvious impact of such sentiments on Carter, Alan Greenspan, chairman of President Ford's Council of Economic Advisers, a sharp critic of past administration economic policy, finds Carter's new stance convincing.

And Greenspan would not regard some shifts, say, calling for a relatively small tax cut to become effective with the 1981 budget, as a significant retreat.

"I do find him convincing basically because he's a fiscal tightwad," explains Greenspan. "Convincing, yes. When push comes to shove, will they stay that way? I don't know. But is it just political rhetoric right now? No, it's not.

"What really counts is the expenditure side. It's not taxes. After all, he is going to have to cut taxes somewhere along the line, given the tax system and these inflation rates.But if Congress comes in with a budget that's even $3 billion or $4 billion over his budget, and he goes along, he will have caved."

Any real pressure on the president to shift back to stepping on the economic gas will be slow in coming. Even those economists predicting a recession are now saying it won't come until the latter part of the year. Moreover, even those forecasts, for the most part, envision a very mild recession.

Clearly, until the economy turns down sharply and unemployment begins to rise noticeably, Carter will be under no pressure. That is one reason that Treasury Secretary W. Michael Blumenthal has been telling friends that, whatever the unemployment level at which Carter might have to reverse himself, it will not be reached in 1979.

If the administration's more optimistic forecast -- sluggish growth for a time beginning late this year but no real recession -- is realized, Carter would be able to keep his policy largely intact through the 1980 election.

But what will happen if a serious slowdown comes? First, the fragile consensus among Carter's top advisers probably would break down. Domestic policy adviser Stuart Eizenstat, among the last to accept the need for the present policy, likely would be among the first to argue for change. Less significantly, perhaps, Labor Secretary Ray Marshall and Secretary of Housing and Urban Development Patricia Harris would probably join him quickly.

The president's response to a rise in unemployment, however, does not have to be all-or-nothing. Blumenthal, who has a more conservative bent, will not abandon his position at the drop of a hat. After all, says another Carter adviser, "The thing to avoid at all costs is to give a sense of turning policy on a dime."

Should the economy force a retreat for Carter, in other words, look for it to be a retreat and not a rout. Most administration officials are very reluctant to lay out a scenario in which Carter moves once more to stimulate the economy. But when pressed, they describe a series of temporizing moves.

The president's first step, in those circumstances, might be to seek a bit more money for public service jobs, suggests one official. That would be directly responsive to higher unemployment, but would not commit the administration to any added spending that would have to continue indefinitely.

A second response probably would be the sort of tax cut mentioned by Greenspan. Carter has been shooting for a balanced budget in fiscal 1981. Administration sources have said that the combination of economic growth, the way inflation effectively raises taxes, and continued spending restraint might just achieve that goal.

But what would be better politics in 1980, balancing the budget or cutting taxes? If the spending restraint is still clearly visible so that no Carter opponent on the right can take the fiscal responsibility issue away from him, the tax cut looks like a good bet.

A cut would be consistent with Carter's other announced budget goal: reducing its size relative to the economy. Since there are further large increases in Social Security taxes scheduled for 1981, Carter might decide to ask that they be cut back. Then he could also argue that the tax cut would not add to inflation, but help reduce it by trimming some of labor's cost to business.

What might the unemployment trigger point be? There seems now to be the intention of riding out a gradual rise at least up to 7 percent, so long as the prognosis at that time is not for a deepening recession.

The real key may be the inflation rate anyway. If inflation were to stay as high as it has been lately -- in the 8 percent to 9 percent range -- then Carter might not have much choice, politically or economically. But if inflation moderates a bit after the next few months, as administration economists predict, then the unemployment rate will contain most of the potentially destructive political dynamite.

A lot of Democrats, like Tip O'Neill, are going to be awfully unhappy long before the unemployment rate gets close to 7 percent. Black leaders, such as the Urban League's Vernon Jordan, are already complaining bitterly about Carter's switch to restraint when black unemployment is still extremely high (11.5 percent in December, compared to 5.2 percent for whites).

As the year unfolds, Carter, like Nixon, might panic. But all the signs indicate that he will not, and that the economic policy levers will stay exactly where he will set them this week with his new budget.