President Reagan named veteran diplomatic troubleshooter Philip C. Habib as a special envoy to Central America yesterday and said his mission was "to achieve a diplomatic solution" in Nicaragua with the help of military pressure from rebels opposing the Sandinista government.

Continuing his campaign for congressional approval of $100 million to assist the rebels, Reagan appeared in the White House briefing room to announce Habib's appointment and defend controversial administration tactics in behalf of the package, which includes $70 million in military aid and $30 million in humanitarian assistance.

Habib, 66, came out of retirement to be Reagan's special envoy to the Philippines during the last days of the Ferdinand Marcos regime. He replaces Harry Shlaudeman, 59, who is expected to be named ambassador to Brazil.

Although Reagan said Habib's efforts would be directed at a political settlement, he said there should "be no misunderstanding" about the need for military aid to the rebels, known as contras.

"Ambassador Habib's efforts to achieve a diplomatic solution must be accompanied by an increasing level of pressure on the Nicaraguan communists," Reagan said. "The legislative proposal for aid to the unified Nicaraguan democratic opposition must be approved."

Habib's immediate mission is to meet with El Salvador's president, Jose Napoleon Duarte, who offered last week to negotiate with leftist rebels in his country if Nicaraguan President Daniel Ortega agreed on similar bargaining with the Nicaraguan rebels. Reagan termed this idea, which has been advanced before, "a bold and promising new proposal" and said that both the United States and the leaders of the Nicaraguan opposition were prepared "to seek a political solution."

Nicaraguan reaction to Habib's appointment appeared to demonstrate the difficulty the new envoy faces. Francisco Campbell, political officer in the Nicaraguan Embassy, accused the United States of "sabotaging all possibility of a peaceful solution." He said Shlaudeman's efforts had failed because of U.S. insistence on aiding the contras.

Despite Habib's appointment, which White House officials said was part of a strategy shift to a more positive approach, Democratic opponents of the aid package continued to focus on administration statements that they said had impugned their patriotism.

Rep. Michael D. Barnes (D-Md.) called for the resignation of White House communications director Patrick J. Buchanan, saying he had "exceeded the bounds of acceptable behavior" in a Washington Post op-ed page article accusing Democratic opponents of being "with Moscow" in guaranteeing Soviet expansionism in Central America.

A Republican, Sen. Nancy Landon Kassebaum of Kansas, also assailed administration tactics, saying the issue goes beyond "the claim that this is a simple choice between good freedom fighters and evil Marxists."

But Reagan, in announcing the Habib appointment, said he had not "assailed anyone's motives in this" and was "simply stating facts."

An undecided House member, Rep. James C. Slattery (D-Kan.), urged the administration to withdraw its aid request and instruct Habib to meet with the heads of democratic Latin nations to formulate a proposal to take to Ortega.

Meanwhile, in another attempt to sway undecided congressmen who have voiced concern about the quality of contra leadership, Secretary of State George P. Shultz met with leaders of two rival rebel groups.

Participating were Adolfo Calero, Alfonso Robelo and Arturo Cruz of the United Nicaraguan Opposition, the contra group that has received the bulk of U.S. assistance, and Eden Pastora, whose southern opposition bloc has been held at arm's length by the administration.

Afterward, Elliott Abrams, assistant secretary for inter-American affairs, said Shultz assured them that "our desire is to support every resistance group" as long as they demonstrate commitment to democracy, respect for human rights and international rules of warfare, and willingness to meet together. Abrams said the meeting made progress toward these goals.