The Afghanistan crisis has created great uncertainties and concern in most places around the world, but in Yugoslavia it has been something of a boon.

For it was the Soviet invasion of Afghanistan that completed the transformation of Jimmy Carter's policy toward Yugoslav's from one of frightening neglect to one of reaffirmation of traditional U.S. interest in its continued independence.

Moreover, Carter's changing view of Soviet intentions around the world has restored conditions under which Marshal Tito originally managed to establish Yugoslavia's unique position in Europe.

To understand the reasons for this state of affairs one has to recall that after Tito defied Stalin in 1948 and quit the Soviet bloc, he established an independent communist country within Moscow's keep but beyond its grasp, strongly allied with the Third World, yet on good terms with most Western countries.

Such diplomatic effort was made possible by competing ideological currents in which the United States maintained an interest in Yugoslavia's continued independence. In the 1948-1976 period, the United States extended more than $3.5 billion in various forms of assistance to make the Moscow-Belgrade rift irreversible and deny the Russians access to the strategically located country.

But the entire effort was compromised when Carter, while campaigning for the presidency in October 1976, declared that he would not come to the aid of Yugoslavia in case of a Soviet attack.

Once in the White House, Carter came to regret his gratuitously explicit statement of intentions. As Vice President Walter Mondale told an associate recently, "We worked for almost three years to correct that mistake."

For Tito, who always played for the long term, Carter's campaign statement raised a variety of problems for the future of his country despite U.S. efforts to make amends through statements and gestures of political support.

That the Soviet invasion of Afghanistan and the president's change of policy coincided with Tito's grave illness recently was an exceptionally fortuitous development for Yugoslavia. Press leaks in Washington suggested that the 87-year-old Yugoslav leader, before undergoing surgery, including the amputation of his left leg, has asked for U.S. security guarantees and that Carter had responded favorably.

Well-informed U.S. sources add that Washington's policy toward Yugoslavia reflects the now prevailing public perception of an increasingly assertive Soviet Foreign policy. After Afghanistan, these sources said, it would seem almost mandatory for the United States to help Yugoslavia if it were attacked by the Soviet bloc.

Since the new international climate has reduced the immediate possibility of outside pressure on Yugoslavia, the country's principal problem is to resolve the succession arrangements in a way acceptable to its various national groups.

A revival of ethnic rivalries in the post-Tito transition, which is currently under way, could produce a type of internal turmoil that the Russians could exploit to restore a pro-Soviet government.

Nobody pretends to know the longterm outcome. But certainly the new American interest in Yugoslavia's independence and integrity restores political conditions favoring future stability in the Balkan region. That the Yugoslavs can count on U.S. backing should give additional confidence to Tito's heirs in shaping their future course.

And that the Russians are aware of Washington's renewed interest should work against any rash Soviet moves that could turn the Balkans into the flash point of a new East-West conflict.