President Reagan can be credited with helping to end the Cold War in two somewhat different ways.
First, we can say Reagan's aggressive arms buildup helped to end the conflict. Reagan engaged the USSR in an arms race that was too expensive for the Soviet economy to sustain. This helped to bring down the Soviet system and end the Cold War.
Second, we can say that Reagan's attitude towards Mikhail Gorbachev helped to end the Cold War. Reagain was personally friendly with the Soviet leader. He was also willing to talk to Gorbachev on issues like nuclear arms reduction. This may have helped to make Gorbachev more willing to adopt reforms because he felt he had little to fear from the United States.