As the Reagan administration gets ready to decide how to do right by Corazon Aquino and the people power that swept her into the presidency of the Philippines, it would be wise to remember how and why things turned out as well as they did.

Secretary of State Shultz made the most important point: It was a Filipino show. It was brave people ready to stare down a tyrant and his tanks. It was a remarkable woman of great grace and decency whose campaign was turned into a democratic crusade.

It was also, in a particular way, Marcos' show. He is not the first aging, ailing, out-of-touch authoritarian to self-destruct by miscalculating what he could get away with: a clumsy cover-up of a conspiracy to murder Benigno Aquino that reached high into his regime; a gross underestimation of his opposition that led, inexorably, to the lying, the stealing -- the thuggery -- when he found he couldn't win an honest count.

If his own overbearing arrogance accounted for much of Marcos' miscalculation, there is at least one thing to be said in mitigation of this otherwise unpitiable figure. The signals he was getting from the United States government at critical moments in the recent Reagan years were, to put it mildly, mixed.

Yet one more time, we were treated to the familiar spectacle of an administration with a president and a few true- believing cohorts speaking one way with a heavy ideological content and a pretty simplified world view, while the much- maligned professionals struggled with complex realities. You know the sort of professional people -- the ones who "lost" Iran, who messed up Vietnam by pressuring Ngo Dinh Diem for reforms to the point of getting him overthrown and killed. Well, maybe they did, but maybe in each case simply spun out of U.S. control.

But in the case of the Philippines, you have to hand it to the professionals. To the extent that the United States contributed positively to the outcome, it was mostly owing to the principled positions taken by Shultz and to the counsel he got from experienced old hands, here and in Manila. And it was not made easier by the either/or argument of those who saw Marcos as the only alternative to a communist insurgency and the loss of our rights to Clark Air Base and the naval base at Subic Bay.

Ronald Reagan arrived at the White House with a deep affinity for the Philippine president, martial law and all. Vice President George Bush was only reflecting a presidential prejudice in his famous tribute: "We love your adherence to democratic principles and to democratic process."

But what was Marcos to make of it, if not that he had a pretty sweeping license to practice autocracy? What was he to think, in November 1983 after the assassination of Benigno Aquino and with a heavy cloud of complicity hanging over his government, when Reagan apologized almost abjectly in a "Dear Ferdinand and Imelda" personal note for passing up the Philippines on an Asian tour later in the month. "I want you to know that I have always had confidence in your ability to handle things," Reagan wrote. "Our friendship for you remains as warm and firm as ever."

By October 1984, four out of five members of a commission appointed by Marcos himself had traced the Aquino assassination plot up the chain of command to the armed forces chief of staff, Gen. Fabian Ver, an intimate of both Mr. and Mrs. Marcos. The State Department was publicly pressing hard for justice. Even Reagan, in his foreign- policy debate with Mondale, conceded, "There are things there in the Philippines that do not look good to us from the standpoint right now of human rights." But the only alternative, he added, is "throwing (the Philippines) to the wolves and then facing the communist power in the Pacific."

What was Marcos to think, even after the State Department took the unusual step of issuing a statement to the effect that the president really didn't mean what he said. Even after the flagrant fraudulence of the Marcos "election," Reagan averted his gaze by widening it to include the possibility of fraud "on both sides." You could hardly blame Marcos for requiring confirmation from the president's trusted intermediary, Sen. Paul Laxalt (R-Nev.) before he would believe that a statement issued earlier in the name of the U.S. government, urging him to step aside, actually represented the views of his old friend in the White House.

The struggle having now been resolved in favor of Mrs. Aquino, with every reason to hope for the best, one would expect U.S. policy to proceed pretty much with one voice. But we have no idea what accommodations the new president will have to make to consolidate her rule. So we don't know exactly what forces the United States will be contending with in its efforts to reinforce urgently needed reforms -- economic, military, judicial.

Ultimately, there will be tough policy choices on U.S. economic and military aid, and on the terms. Events of the past few weeks tell us that the choices will be best informed when they are informed by professional advice and counsel.