Gorbachev had a good relationship with the United States
Gorbachev worked to improve relations with the United States, the Soviet Union's Cold War foe, in addition to his internal reform programs. He and US President Ronald Reagan agreed to eliminate their respective nations' remaining intermediate-range nuclear arsenals when they signed a deal in 1987.
According to Gorbachev, maintaining positive relations with other countries, particularly the United States, was the only way to improve the Soviet Union's economy. Gorbachev reduced the Soviet military presence in the Warsaw Pact countries of Eastern Europe as a result of this. Additionally, this contributed to Eastern Europe's rapid collapse.
Gorbachev ordered the Soviet military's departure from the country's occupation of Afghanistan between 1988 and 1989. To ensure Afghanistan's allegiance to them in the Cold War against the mujahideen supported by the United States, the Soviets invaded Afghanistan in 1979. By the late 1980s, the Soviet army had lost about 15,000 soldiers and had failed to install a supportive government. Apart from avoiding embarrassment on the public stage, they had little motive to stay in Afghanistan.