The Supreme Court, struggling to help law enforcement officers through a maze of confusion on the law of search and seizure, yesterday announced ground rules for police to follow in searches involving automobiles.

In a major departure, the court rules that a police officer who has stopped a car and made a lawful arrest may, without a warrant, search virtually anything in the passenger compartment.

In a separate case, the court said searches of car trunks are subject to tight restrictions. The court said an officer needs a warrant before opening a closed container unless its contents are in plain view or obvious, for example a gun case.

Justice Potter Stewart, writing for the court in both cases, tried to establish broad principles to guide law enforcement officers, but his effort provoked a barrage of criticism from colleagues who accused him of further confusing tangled interpretations of when the Constitution allows a warrantless search.

Stewart distinguished between the two cases on the basis of the type of searches that the officers were conducting.

In New York v. Belton, a New York state trooper stopped a speeding car, placed its four occupants under arrest for possession of marijuana and ordered them out of the car before he searched the passenger compartment. In the zippered pocket of a jacket on the back seat, the tropper found some cocaine.

Reversing a decision by the New York Court of Appeals, Stewart said the warrantless search was justified because it was conducted at the same time as the arrest and was limited to areas of the car in which as supect might reach for a weapon or a piece of evidence.

In such cases, Stewart wrote, the arrest and a lone officer's need to protect himself justify an infringement on the suspect's interest in the privacy of items in the passenger section.

Chief Justice Warren E. Burger and Justices Harry A. Blackmun, Lewis F. Powell Jr. and William H. Rehnquist joined in Stewart's opinion. Justice John Paul Stevens agreed on separate grounds, and Justices William J. Brennan Jr., Byron R. White and Thurgood Marshall dissented.

Brennan wrote that the court had "turned its back" on 50 years of what he admitted were "conflicting" decisions, limiting the scope of such searches immediately following an arrest.

Brennan protested that the effect of the new rule, which the majority justified as a "guide to the officer in the field," will be to allow police to conduct warrantless searches in circumstances where the suspect has no opportunity to reach a weapon or destroy evidence.

In the second case, Robbins v. California, three justices joined Stewart in his opinion while Burger and Powell concurred in the result. In that case, highway patrol officers stopped a station wagon, searched the passenger compartment and found marijuana and paraphernalia for using it.

The troopers then opened a luggage compartment, saw two packages wrapped in opaque green plastic and, without a warrant, unwrapped them and discovered 30 pounds of marijuana.

While courts have ruled that a person's expectation of privacy is somewhat diminished in cases involving automobiles, which are used for transportation and not as a place to store personal items, Stewart said that principle does not apply to a closed piece of luggage typically considered a private repository no matter where it is located.

Stewart rejected arguments that the nature of the container, for instance, a suitcase compared to a cardboard box, reduces constitutional protection against warrantless searches under the Fourth Amandment. Once placed within a closed, opaque container, Stewart wrote, "a diary and a dishpan are equally protected by the Fourth Amendment."

Citing the confusion of cases in the courts, Stewart noted "it is difficult, if not impossible, to perceive any objective criteria" that could be used to inject into the Fourth Amendment a distinction among types of contianers.

". . . No court, no constable, no citizen can sensibly be asked to distinguish the relative 'privacy interests' in a closed suitcase, briefcase, portfolio, duffle bag or box," Stewart wrote.

In the Robbins case, the California Court of Appeal said any experienced observer could conclude that the sealed packages found by the troopers contained bricks of marijuana, but Stewart said evidence in the case was insufficient to support that conclusion.

In a footnote, Stewart cited a dissent in the lower court in which a judge said he thought the packages bore a "remarkable resemblance to an unlabeled carton of emergency highway flares that I bought from a store shelf and carried in the trunk of my own automobile."

Powell, in a separate opinion, agreed with Stewart's decision in Robbins but only because he believed the defendant clearly had a privacy interest in his carefully wrapped marijuana bricks.

While agreeing that the law of search and seizure for automobiles is "intolerably confusing," Powell accused Stewart of proposing a "mechanical requirement for a warrant" before police can search any closed container. That would impose new burdens on law enforcement agencies, he said.

"Confronted with a cigar box or a Dixie Cup in the course of a probable cause search of an automobile for narcotics, the conscientious policeman would be required to take the object to a magistrate, fill out the appropriate forms, await a decision and finally obtain a warrant," Powell wrote.

That expenditure of time and effort, involving even the most trivial containers, is not justified, Powell wrote. Noting that the Robbins case came late in the term, Powell said he hoped a future case would give the court a chance to come up with "some better, if more radical solution to the confusion that infects this benighted area of the law."

Blackmun, Rehnquist and Stevens, who dissented in Robbins, said confusion could be eliminated by allowing the search of all packages in automobiles, regardless of where the packages are or what they look like.