The Cold War came to an end when the USSR had lost its will for empire led by Gorbachev. It could not sustain the resources needed to pursue an empire it no longer felt it needed, it couldn't compete with the West and it needed a domestic change.
First of all, the invasion of Afghanistan forced the USSR to evaluate its situation. It was a battle over the Soviet influence in Afghanistan and third world countries. The Soviet leader Gorbachev with his new political thinking. Over 15,000 Red Army soldiers were killed in the war, which cost $8 billion per annum lasting over 10 years. Gorbachev felt it unnecessary and shameful to their citizens and Bolsheviks after 60 years. He wanted to make the Soviet system more productive and responsive. He recognized that in order to achieve this, military spending had to be reduced. This could be done only if arms limitation talks with the USA were reopened.
Arms agreements would allow Gorbachev to reduce military spending without leaving the USSR exposed to attack, and therefore avoiding opposition at home from the Soviet armed forces. Not only on arms but the USSR spent approximately $40 billion annually on propping up communist governments throughout the world. Gorbachev thought this money could be used to promote domestic reform. He also began seeking a little human right in Soviet Union and other communist states, no longer furthering interest of world communism. Thus he introduced domestic policies of Perestroika, Glasnost and Democratization to free Eastern Europe from Soviet sphere. In 1989 Hungary adopted a multi-party government and Polish elections returned a non-communist government, and reunification of Germany.
Not only unwilling to pay for it's foreign influence, yet it wasn't efficient. The US adopted hard-line policies against its expansion. It militarily supported third world countries...