It is a measure of Jimmy Carter's failure that Ronald Reagan should have to be thinking about oil and natural gas policy at all. The things that needed doing were clear four years ago. Carter saw the basic need, whence came his famous phrase, the "moral equivalent of war." But his intellectual and political powers faltered at the task of proposing and enacting a successful program. Reagan needs to clean up this mess, but it's questionable whether he will.

The essentials of the mess are simple. Today government, holds the price of natural gas (about one-fourth of our energy supplies) below market levels, encouraging people to waste it. Government taxes oil production but not consumption; in an oil-short world, this makes not a wit of sense. And, finally, government now proposes subsidizing synthetic fuels to replace the oil and natural gas whose overconsumption and underproduction it's encouraging.

On the subject of energy, Carter was hypocritical. He claimed to champion "conservation," and yet he stoutly resisted the only conservation program worth a hoot: letting prices rise to market levels. He claimed to be an environmentalist, and yet he has artificially boosted a synthetic fuels program that inevitably poses monumental environmental hazards.

What should Reagan do? Also simple:

Decontrol natural gas prices. Legislation enacted in 1987 releases some natural gas from price controls between 1985 and 1987, but the complicated transition rules have left retail natural gas prices at about half the level of their oil equivalent. And, according to the Energy Department, the legislation could mean that about 30 percent of gas remains under controls in 1990.

Modify or repeal the "windfall profits" tax. There may be some merit in a tax on oil from wells producing in the early 1970s, but the case fades for taxing new production or oil from "enhanced recovery" projects. The major effect is to make some worthwhile projects uneconomic.

Repeal the legislation making the government, through loan guarantees, price guarantees and outright grants, a partner with industry in promoting synthetic fuels. True, investments, for these projects usually run into the billions, but so do the profits of energy firms. They ought to bear the normal commercial risks.

Impose a gasoline tax of between 30 cents and 50 cents a gallon. The insecurity of world oil supplies makes it imperative to keep global demand low enough so that slack production capacity exists; then, in a crisis, some countries could raise their production. If the United States increased its gasoline tax, it could forcefully argue that the Europeans and Japanese should do the same. Rebated to consumers through reductions in other taxes, the tax could boost consumer purchasing power, economic growth and employment.

It will be a test of Reagan's political skills to see if he can -- or will -- set things right. A sensible energy policy has always foundered on the unappetizing prospects of immediate increases in prices and higher oil company profits. The argument is made that we shouldn't let the oil cartel control energy prices.

The trouble is that these slicksounding debating points produce policies that make us more dependent, not less. Reagan's energy task force suggests removal of controls that hurt oil producers but waffles on abandoning subsidies for snythetic fuels. This is a lopsided approach that, if adopted, would make Reagan appear a front man for the oil industry.

The essential thing to grasp about oil and natural gas policies is that they involve resource allocation. It makes no sense to spend $35 to import a barrel of oil or produce a barrel of synthetic fuel, if the same barrel (or equivalent in natural gas) can be produced for $34 or saved through comparable energy efficiencies.

The dollar costs simply signify the labor, material and other resources (including land and energy itself) that go to energy. As a nation, we want to keep these costs low; in this sense, we want cheap energy. But cheap energy has never meant artificially low prices.

Although no one knows the extent of this country's remaining reserves of oil and natural gas, three things can be said with confidence:

First, abundant sources of truly inexpensive energy have disappearerd.

Second, higher prices make it more attractive to recover smaller, deeper and more tightly compressed reserves.

And third, even these high-cost sources are probably less expensive than most synthetics. Higher prices also bring our efficient alternatives, including conservation and, possibly, solar power.

Giving special encouragement to synthetics is not only silly economic policy but also silly environmental and social policy. In general, squeezing a liquid or gas from shale or coal is a messy, smoky process that requires more people and water than producing nature's oil and gas. Resource-rich western states already are undergoing a spasm of economic growth; they need time to cope with the strains. Technologies for synthetic fuels differ; time and competitive pressures are needed to weed the good from the bad.

Carter got it all backwards. He could not resist inveighing against the oil industry. Consequently, he refused to decontrol natural gas prices and only belatedly accepted a phased decontrol of oil prices (it ends next September). But, in return, he insisted upon the "windfall profits" tax, which means that government gets between 30 percent and 70 percent of all price increases.

Many environmentalists are similarly confused. The federal government controls much of the land (and the offshore areas) available for oil and gas development. By advocating restrictive access to these lands, environmentalists created unwholesome prussures for a premature synthetics industry. Better to give the oil companies, more freedom to search for conventional fuel than to push them toward synthetics.

What Reagan needs to fashion is an alliance between old adversaries: the environmentalists and the producers. But it is a piece of political architecture as difficult as it is essential.