The plight of Supreme Court nominee Robert H. Bork and of Ronald Reagan's favorite cause, the Nicaraguan contras, advertise the limits of a weakened president's authority in dealing with an opposition Congress near the end of his second term.

The useful lesson for Reagan, if he wants to learn it, is that he can no longer prevail through confrontation. He can probably succeed in putting a conservative on the Supreme Court, but he is going to have to choose his next nominee carefully and show respect for the Senate. And, if he holds any hope of helping the rebels he calls "freedom fighters," he is going to have to convert military assistance into humanitarian aid before taking the contra package to Capitol Hill.

The Bork nomination was an attempt to use political capital that Reagan had squandered before the fight began. Bork's moment should have been in 1986, when Reagan still seemed a political magician, but the president passed over him in favor of the younger Antonin Scalia.

Scalia was arguably to the right of Bork or even William H. Rehnquist, whom Reagan elevated to chief justice. But as the first Italian-American nominee to the court, Scalia was also a sure bet to be confirmed by a Senate that loves "firsts" that reward significant constituencies. Reagan took the easy way out, as they used to say in the Nixon administration, and left the capable and provocative Bork to history. He doubtless would have prevailed with Bork in 1986 and with Scalia now.

The political calculus of Bork's nomination was always dubious. It rested on an outdated assumption that "southern" is synonymous for "conservative." It ignored the most significant recent event in the nation's political history, recapture of the Senate by the Democrats last year after a campaign that Reagan unwisely made a referendum on his presidency. It also ignored the reality that the southern senators who were targets of the confirmation effort held office because of support from blacks, trade unions and liberals who mobilized against Bork.

The conservative complaint that Bork lost because the White House tried to fob him off as a disguised moderate is ludicrous. Bork was a lost cause under any coloration with Democrats running the Senate, but Reagan and Attorney General Edwin Meese III refused to recognize the changes in the political landscape. As a battered ally of White House chief of staff Howard H. Baker Jr. put it last week, "If we had thrown right-wing grenades to get Bork confirmed, we'd have lost, 80-20."

If Baker, who was never particularly bullish on Bork, is to be faulted, it is for failing to try harder to make the president aware of the new realities. He will have plenty of other opportunities, if he sticks around. Since the 1986 election and the damage inflicted by the Iran-contra scandal, Reagan has failed to sustain vetos of the clean water bill and the highway-mass transit bill. He averted another veto override only by changing course at the last minute and signing a deficit-reduction measure he despises.

Even without the Senate and his Iran-contra baggage, Reagan is far from being the traditional lame duck. He has shown that he possesses clout in foreign affairs, both in pursuing an aggressive policy in the Persian Gulf and in seeking an arms-control accord with the Soviet Union. Last week, under the guidance of national security adviser Frank C. Carlucci, the president struck a useful compromise on a bill that will provide $1 billion in military aid for Saudi Arabia, a vital U.S. ally.

There are those who think that Reagan can even strike a bargain on the contras, if he is willing to settle for food and other nonmilitary supplies. He can certainly influence unresolved items of domestic legislation -- notably catastrophic health insurance and the trade bill -- if he is willing to dirty his hands in the hard work of negotiating compromises.

Reagan is neither the irrelevant president his opponents would like him to be nor the revered leader who six years ago pushed Congress into accepting programs that its members were afraid to oppose. He is in the end game of his presidency and can prevail only if he accepts his limitations. The time for confrontation is over.

Reaganism of the Week: After expressing support for school prayer in a speech to educators in the Rose Garden last Monday, the president said, "Actually, as long as there are final exams, there will be prayer in schools."