Ronald Reagan always heavily criticized the Soviet Union and offered support to anti-communist opposition in central Europe as a way to weaken the Soviets. Reagan trained, equipped and lead many forces against the Soviet Army, which helped to end the Soviet occupation of Afghanistan.
Gorbachev also was responsible for the end of the Cold War, he needed support to lift the Soviet’s economy and found in Reagan an ally. Gorbachev made a series of reforms such as the Perestroika that allowed open market forces to be introduced in the Soviet economy.
With that, the Detente policy was able to be imposed, it meant that tensions were relaxed. The Nuclear non-proliferation Treaty, the Helsinki Accords were signed.