Treasury Secretary G. William Miller warned yesterday that the nation must go through "a period of austerity" for at least the next two years "to wring inflation out of our system."

In an interview, Miller said that the nation must "forgo for now" a tax cut, or any stimulus that might worsen inflationary trends.

The austerity period, he predicted, will have the full backing of the public "provided it is fairly shared," which means that workers must accept lower real income, and businesses must accept "some erosion" of profits.

On the current recession, Miller said it will be relatively short and not severe. He predicted the economy will begin to bounce back early next year, the most optimistic view of any top Carter administration official.

Miller acknowledged that belt-tightening over "the next couple of years" will adversely affect the poor, the elderly, and those on fixed incomes, all of whom suffer from double-digit inflation. But ways can be found to ease their burdens, he said.

"The rest of us will just have to take a little bit less for a period of time, in order to have more later," the treasury secretary said.

He said that the process had already begun, because labor was accepting an average wage increase less than the rate of inflation, and the existing price guidelines plus inflation had caused a reduction in real business profits.

"The real villain in the inflation story," Miller said, is the oil cartel's price increase as it has been moving through the economic system. "Everybody suffers a very serious increase in costs, and Americans are willing to accept that and tighten their belts, and accept it fairly as part of the austerity."

He indicated that President Carter -- who designated him as the administration's chief economic spokesman and policymaker -- is in accord with his belief that the administration must face down inflation, without the usual pump-priming resorted to during times of recession.

"We've got to stay constant in our purpose," Miller said. "We cannot at the first sign of difficulty take precipitious action that puts us back onto our treadmill of inflationary forces."

To underline the administration's determination to "hang tough," and resist Republican pressures for a broad-scale antirecession tax cut, Miller refused to set out any trigger point in terms of the unemployment rate, or any other development that would lead the administration to reverse policy and adopt a stimulative program.

He acknowledged that layoffs could become a problem, especially in the automobile industry, but poined to the unemployment insurance and supplemental benefits available to cushion unemployment in that industry.

"You have to look at unemployment not only this year," Miller said, "but what it may be five years from now, if we don't do something about this inflation. Long term, we'll have very serious unemployment if we don't control inflation."

Nonetheless, Miller said that it should not be necessary to delay tax relief for as long as two years, because over that period, "there could be tax cuts" as federal expenditures decline in relation to gross national product.

He holds to the view that if and when the time for a tax cut comes, an effort should be made to combine "anti-inflation aspects" with the stimulative effect. Thus, for individuals, he would favor cuts in Social Security taxes (which also help cut business costs), and corporate tax cuts that increase the incentive for investment.

"The timing should be held until we have shown that we are disciplined in our fiscal policies, and therefore we are not relenting prematurely on the determination to work towards a balanced budget," Miller said.

Behind Miller's counsel to the president to hold off on antirecession programs, including any tax proposals for the immediate period, is a conviction that the current recession "will be relatively shallow and not of extended duration."

He predicted that the 2.4 percent decline in the second quarter gross national product will be followed by another dip in the current quarter, thus qualifying the six-month period for the popular definition of recession -- two consecutive quarters of decline in real GNP.

But in the most optimistic projection yet by a leading administration official, Miller said "the fourth quarter may be kind of neutral, and by the first quarter next year, let's say, we may begin to see some recovery.

"If you think of it, we're halfway through it and we haven't had tremendous strains or pressures."

The only real danger to the economy that could produce a more serious recession, Miller said, is some event such as a new interruption of oil supplies. More than many private economists, he shucked off the possibility of any serious "drying up" of consumer or business spending, or the prospect of over-heavy business inventories.

But Miller was extremely cautious to discussing interest rates, which have risen to record highs since he was replaced at the Federal Reserve Board by conservative Paul Volcker. Some private economists fear that the Fed's policy will exacerbate the present recession.

Miller said that it is only natural that short-term interest rates are high, because the rate of inflation is so high. And he praised Volcker's qualifications for the job, and the need to restrain the explosion of money and credit.

But asked whether Volcker's policy of pushing interest rates higher is the right one, Miller would respond only that "their (the Federal Reserve's) direction is correct, and certainly consistent with what happened during my 17 months at the Fed.And so I find no fault with that direction."

Pressed to say whether he was distinguishing between the direction and the intensity of the policy, Miller said he would not judge "who does what on what day." He pointed out that on his own last day in office, "an action was taken to tighten policy" and that the growth of money and credit must be restrained "gradually . . . until we contribute to wringing out inflation."