The Democrats came out of Tuesday's elections thinking of ways to elect a presidential candidate while the Republicans, confident of their power to elect presidents, were concerned with building at the state and local levels to help bring about a political realignment that would make them the dominant party.

Democratic Party leaders expressed gratitude that they had gained two U.S. Senate seats, relief that their losses of House seats -- 15 with another three still up in the air -- weren't more severe and admiration for their candidates who withstood President Reagan's landslide victory.

Immediately after the votes were counted, national Democratic officials were talking of the need to bring their governors, state legislative leaders and local office holders more into the national councils to offset what they think is the party's Washington-oriented image among voters.

There was widespread agreement that the party needed to move more to the center on the national level, match the Republicans' rhetoric on economic growth and individual opportunity and somehow crack the Republicans' Electoral College base in the West and South.

The Democrats noted with dismay the GOP's almost 2-to-1 advantage among young voters, which they attribute in part to the economic recovery and young people's sense of optimism.

The Democrats also expressed concern that southern voters in the presidential election appeared to be polarized between whites who voted for Reagan and blacks who overwhelmingly supported Walter F. Mondale.

Absorbing a hard-won lesson from the comparison of Reagan and Mondale, they also were talking of the need to choose a candidate who is effective on television as well as being substantive on the issues.

"We need to select a national chairman who will be the party's spokesman on television on the issue of the day," said Gov. Bob Graham of Florida. "Without a strong party chair, the response goes to the congressional leadership . . . which by definition is going to be older, Washington-based and Washington-oriented."

Graham also urged a new method of selecting presidential candidates, "a national primary or a limited number of regional primaries. As long as we put candidates on endless march from Iowa to California you are forcing them to appeal to one special-interest group after another and by the time they are nominated, they have been politically emasculated . . . nonelectable."

The Republicans' concern was just the opposite.

"I think Reagan reached a fair distance down in trying to create coattails but there is not a grass-roots Republican Party strong enough to reach up and grab the hand," said Rep. Newt Gingrich (R-Ga.) "The challenge to my generation is to go out and create a grass-roots opportunity party."

While the Democrats talk of absorbing political strength and wisdom from the hinterlands, the Republican National Committee is sending advisers to help build their county organizations in the hope of controlling a majority of state legislatures by 1991 for the next congressional reapportionment after the 1990 census. This includes setting up fund-raising, voter registration and training programs.

"We've undergone the first step, the philosophical realignment of the voters' attitudes toward government and economic growth," RNC Chairman Frank J. Fahrenkopf Jr. said yesterday. "I think with our 2-to-1 margin of first-time voters, we'll make our 1990 target. Studies show that 80 to 85 percent of voters stay with the party they first voted for."

The Republicans are concentrating on 1,100 counties of the nation's approximately 3,300 and hope to finish the rest by the end of the decade.

The Democrats' concern is the Sun Belt and presidential elections.

"We can't write off the South and West and win national office," said Rep. Tony Coelho (D-Calif.), chairman of the Democratic Congressional Campaign Committee. "California was closer for Mondale than the rest of the country, so we have a chance, if we handle it right, to put together the winning coalition by using California in 1988.

"I say the Reagan revolution is over, we stopped realignment in the House in 1982 and kept it stopped in 1984. We're very healthy now at the state and local levels and the target now is the national ticket," Coelho said.

A major problem for the Democrats is the South, where very few whites voted for Mondale.

"There was a literal white flight from the Democratic Party all across the South," said George Christian, a former White House press secretary for Lyndon B. Johnson and now a political analyst in Austin, Tex. "It's very damaging to the Democratic Party."

Georgia Democratic Chairman Bert Lance expressed the hope that the party won't be racially polarized in the South but said it depended on the Democrats' nominating more moderate presidential candidates and not having two northern liberals on the ticket as they did this year.

"I'm optimistic we won't have a polarization problem," Lance said. "The national party has to move in the direction the voters are moving in. That's why I thought it was important to have a southerner on the ticket. The ticket wasn't balanced . . . and it created a real problem for us in the South."

The only two elements of the Democratic coalition who gave Mondale a majority of their support were blacks and Jews, but they illustrate the Democratic Party's problem in the South.

Blacks supported him by nearly 90 percent and ABC News exit polls indicated that Mondale won about 70 percent of the Jewish vote, although the American Jewish Committee and the National Jewish Coalition contend that their surveys show that he won only about 55 or 60 percent of the Jewish vote.

However, many Jewish voters supported Mondale primarily because their dismay over the influence they saw white fundamentalists wielding at the Republican National Convention in Dallas outweighed their outrage over what they see as the anti-Semitism of Jesse L. Jackson and Minister Louis Farrakhan of the Nation of Islam.

"Two months ago the Republicans were justified in believing that they were on the brink of an historic accomplishment, getting 50 percent of the Jewish vote in the aftermath of Jackson and the Democratic convention's failure to condemn anti-Semitism," said Hyman Bookbinder of the American Jewish Committee. "The Dallas convention with its church-state religious issue was electrifying, a very serious, serious thing for the Jewish community. The presence of Jerry Falwell, the president's speech at that famous prayer breakfast, the passage of bills on prayer in school was a real source of anxiety to Jews."

Bookbinder said it "is sad that a party [Democratic] that is seen as one of minorities and the poor is not one that appeals to the bulk of Americans."

But he agreed with spokesmen for both parties when he said the answer is with "a very substantial group of middle-age, middle-class moderate, middle-of-the-road Democratic senators, governors and House members. Can they balance extreme leftists, blacks, Jews, the poor, minority groups? . . . both parties have to define themselves in terms of extremists, the radical right and the Rainbow Coalition."

One of Mondale's top strategists said that the Democratic convention, which he considered highly successful, was a good first step in Mondale's going after "weak Democrats."

"They are not weak because they doubt the Democratic Party's compassion, its concern for the poor or the weak or minorities," he said, echoing Sen. Ernest F. Hollings (D-S.C.), a candidate for the 1984 Democratic presidential nomination. "They are weak Democrats because they doubt the party has changed its thinking enough to recognize the need for fiscal self-discipline, economic opportunity and military preparedness."

He also defended the controversial decision to spend so much time early on in the South and West.

"The West Coast states were -- and are -- battlegrounds and [campaign director James A.] Johnson was right in saying you couldn't write off the South and still expect to win a national election."

Republicans, basking in the aftermath of Reagan's triumph, think they have an advantage over the Democrats in the battle for the political center until, as one put it, "the Democrats get a more moderate candidate out of the left-wing orgy of their nominating process."

"We have a unique opportunity with the young, blue-collar ethnic Catholics, Jews and Southern Democrats and our opportunity to get them permanently depends on what happens in the next term," said Roger Stone, a strategist for the Reagan-Bush campaign. "We have to keep the faith with them -- economic expansion for the young, a strong defense for the Southerners, traditional values for the ethnics and Jews plus a solid position on Mideast issues."

Another important lesson that appears to have been strongly impressed on the Democrats is a candidate's need to use television effectively.

"There was no way to judge him Mondale on a televised campaign," said Chris Matthews, an aide to House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.). "But politicians react to the last war. They went looking for a regular after [George] McGovern and Jimmy Carter. Next time they'll look for a regular who's good on television."