President Carter's efforts to win friends and influence "to draw Eastern Europe into cooperative undertakings," as he told the London summit meeting in May, seems to be making some headway.

In Wednesday, the first U.S. Secretary of Defense to visit Communist ruled Yugoslavia will arrive here for a three-day stay that American and Yugoslav officials describe as "very significant."

Next spring, Yugoslava President Tito is expected to visit Washington.

Relations between the two countries, which have been troubled for several years and definitely sour as recently as a year ago, "are now better than ever," said a senior Foreign Ministry official here.

Last month, American evangelist Billy Graham visited Hungary on an unprecedented and unofficial trip that had the open blessing of a new American Baptist President and the tacit approval of the relatively liberal Communist government of Janos Kadar.

Next month, Carter will visit the Polish capital Warsaw an event with unpredictable long-term effects. The trip is almost certain to stimulate and intensify an inherent feeling of warmth among many Poles toward the United States.

Even in East Germany, among the most officially devoted Soviet allies in the Warsaw Pact, there are signs of a warming trend toward the United States.

The East German government wants to expand its trade with the United States, as do most Eastern European countries, to help pay their mounting deficits.

In May, East Germany proposed a series of new trade and cultural contacts with the United States. It also has been moving to settle several dozen family reunification cases in which East Germans have petitioned to join-relatives in America.

In congressional hearings last month, Arthur Goldberg, the chief U.S. delegate to the 35-nation review conference on European security now under way here, praised East Germany for these resettlement actions even though the same government has been for a decade in the grisly business of selling thousands of so-called "political prisoners" to West Germany at about $15,000 a head.

In his speech to the conference last week, Goldberg also pointed out that this year the United States signed its first cultural, educational and scientific cooperation agreements with Bulgaria and Hungary and concluded at least the negotiating phase with Czechoslovakia on a similar agreement.

All of these countries except Yugoslavia are members of the Soviet-led Warsaw Pact. Yugoslavia, though Communist, has followed a course independent from Moscow ever since Tito broke with Stalin in 1948. That is why U.S. Secretary of Defense Harold Brown's visit here is being viewed as so significant.

In the 1950s, the United States was Yugoslavia's principal arms supplier for major items like tanks, trucks and planes. Since 1961 there have been no deliveries of U.S.-made military equipemnt here.

Yugoslavia now claims to manufacture 70 to 75 per cent of its own conventional weapons, but still depends on Soviet purchases for its sophisticated equipment, despite its independent stance as a nonaligned country.

Though Brown is not expected to sign a new equipment sales agreement on this visit, the Yugoslavs clearly would like American military equipment, and both U.S. and Yugoslav officials expect that an agreement will be set in motion during the visit. Initial purchases are apt to be for things other than weapns, such as supply or communications equipment.

Yugoslavia's location and independence from Moscow has long made it of crucial importance to the West as a buffer state between NATO and the Warsaw Pact along the southern flank. Thus, Soviet tanks are kept from being based on the Italian border and Soviet shops don't have an Adriatic port since Belgrade has so far rebuffed Kremlin pressures for a naval base.

But Tito is now 85 years old, and there is concern throughout NATO about what will happen after he dies. A new link with the Unites States in terms of military equipment supply could be a factor in a post-Tito Yugoslavia, as some officials see it.

Another element in the improving U.S.-Yugoslav relationship, and a possibly important factor in maintaining good relations following Tito, is the new U.S. ambassador here, Lawrence Eagleburger, once a top aide to former Secretary of State Henry Kissinger.

The former U.S. ambassador, Laurence Silberman, was heartily disliked by Belgrade, and by some in the State Department as well, for his outspokeness, particularly in defense of an imprisoned American here.

Eagleburger, Yugoslav officials say, is well liked. He served on the embassy staff here in the 1960s, is regarded as something as a close friend for his handling of earthquake aid during that time, and speaks the language, which is rare for a U.S. ambassador to this country.

U.S. diplomats suggest that the controversial appointment of a top Kissinger aide to a sensitive post was based primarily on a requirement to have someone with good relations in the embassy if Tito passes from the scene within a few years.