Republican Rep. Thad Cochran was campaigning for the Senate in this dusty farm town recently when a voter said something that made Cochran's heart sing.

"I told my wife last night," a farmer named Otis Carroll told Cochran, "I was telling her about you, and I said 'I know it sounds silly,' I said, but I decided I'm going to vote Republican this time.'"

Republican legislator Charles Pickering was campaigning for the Senate in Hattiesburg when he ran into a pleasant octogenarian named Grannie Ryan and had an equally heartwarming experience.

"My daddy would turn over in his grave if he knew," she told Pickering, "but I decided I'm going to vote Republican."

As Republican politicians in Mississippi, Cochran and Pickering are optimists by definition. But this spring, as the two men compete in the June 6 Republican primary to choose a nominee for the Senate seat being vacated by Democrat james O. Eastland, their political hopes have reached new heights.

They are convinced Mississippi will elect a Republican to the Senate this year.

In fact, leaders of the nascent Republican Party here can present a reasonably plausible scenario in which, over the next four years, Republicans gain control of both Senate seats and the governorship in this traditional bulwark of Democratic strength.

A look at Mississippi history shows that such a breakthrough would constitute a considerable political revolution.

The last Republican senator from this state, Blanche Kelso Bruce, who served from 1875 to 1881, was elected by a legislature pacekd with GOP carpetbaggers. The last Republican to win a statewide election Gov. Adelbert Ames, left office in 1876.

For a century, the term "Republication" has been a pejorative label here, carrying with it hated memories of Reconstruction. In this century, the GOP didn't even run a candidate for any statewide office until 1963. Even this year, the Republicans have candidates for fewer than half of the elective offices under contest around the state.

But more and more Mississipians, convinced that the national Democratic Party is too liberal for their taste, have shown themselves willing in cast a Republican vote in recent years.

The GOP carried the state in the 1964 and 1972 presidential elections. In the Nixon landslide of 1972, two attractive young Republicans, Cochran and Trent Lott, were elected to Congress, and both have become enormously successful. Lott has no opposition thi year as he seeks a fourth term, and Cochran seemed headed to an easy reelection victory before he entered the Senate primary.

In 1975, businessman Gil Carmichael galvanized the party statewide by winning 45 percent of the vote in a campaign for governor. Although the bitter Ford-Reagan primary battle of 1976 scarred the GOP here Pickering, a state senator who took over as state Republican chairman from Clarke Reed after that battle, has worked hard to unite the factions into a single force.

Thus this spring, when Reps. Cochran and Lott sat down for a summit meeting with Carmichael and Pickering, the four party leaders were in the heady position of riding a political whirlwind. The "summit" session resulted in a plan to win Republican victories in the next three statewide elections here.

Lott, it was decided, would stay in the House for two terms and work to gain statewide recognition in preparation for the Senate race in 1982, when incumbent Democrat John C. Stennis is expected to retire. Carmichael would start planning immediately for another run at the governorship in 1979.

Both Cochran and Pickering were determined to run for the Senate this year.

Since neither could talk the other into withdrawing, they reluctantly accepted the fact that a primary battle would be necessary. With a week to go before the primary, the race seems too close to call.

Whichever Republican gets the nomination will have a strong shot at victory in November. Confusion in the Democratic ranks and a threatened mutiny of black voters have put the Democrats' prospects in jeopardy.

Six months ago all seemed rosy for the Democratic in this year's Senate campaign. Eastland, who entered the Senate in first year of World War II, was planning to run again, and was a solid favorite to win an eighth term.

But then William Waller, the state's governor from 1971 to 1975 and one of the first white politicians here to seek alliance with black leaders, announced that he would challenge Eastland in the Democratic primary. The current governor, Cliff Finch, who also boasts strong black support, started hinting that he might leap in as well.

Eastland took a second look and, in late March, decided that retirement was the judicious course. Then came the deluge: by the filing deadline, seven Democrats were in the primary race, and two well-known blacks announced plans to run as independents in November.

The leader of the Democratic pack seems to be Gov. Finch, a fiery populist who enjoys impassioned support from a "redneck and blackneck" coalition of campaign workers around the state.

Finch has an uncanny gift for convincing voters that he is on their side against a horde of "professional politicians."

He doesn't use the first person singular alone. Instead, Finch tells audiences that "you and I have made great progress since we became governor. And you and I can do even more when we go the Senate."

All the other Democrats concede that Finch is leading. But they say that, if the governor can be forced into a runoff primary, he will be beaten, because many Democrats here consider anyone preferable to Finch.

The Democrats given the best chance to catch Finch are Waller, Finch's predecessor as governor, Maurice Danton a lawyer of distinguished mien who was won support from much of the Eastland organization, and Charles Sullivan, a former lieutenant governor who claims to be the most conservative candidate in the heavily conservative field.

The Democratic nominee faces a problem in the fall, however, because of the possible loss of an important body of generally Democratic voters - the blacks.

Charles Evers, the mayor of Fayette and a genuine black hero here, and Henry Kirksey, who gained statewide attention for his efforts in the "one man, one vote" campaign, both have announced that they will run as independents in the fall campaign.

Since blacks constitute about a third of the electorate, it is conceivable that Evers or Kirksey could squeeze, out a narrow victory in Novmber. It is more likely, though, that the two will be "spoilers," draining Democratic votes to the benefit of thte Republican nominee.

Another factor that could help the GOP is the absence of issues in the campaign. All the candidates are in general agreement on the conservative side of such questions as national defense, federal spending, and the Panama Canal treaties.

The only issue here seems to be personalities: what kind of man do Mississippians want to represent them in Washington?

Cochran, whose deep voice, tawny good looks, and wavy, silver hair could get him a job as a television anchorman if he ever left politics, thinks he knows the answer.

"People here are embarrassed by the old redneck image of Mississippi," Cochran said the other day. "They want to show the country that we have as many intelligent, up-to-date, impressive young men as any other state."

Cochran doesn't mention it, but among the leading candidates for the Senate here, only two are under 50. They are both forceful, articulate, impressive candidates. And both are Republicans.