He and Andropov before him knew that serious reform was needed if they would remain as a world power and Gorbachev was absolutely moving the country away from communism and toward capitalism. But the USSR was already dissolving and the economic situation had already deteriorated so badly, plus the hard liners in the Communist Party were so determined to stop him, he was forced out before he could realize good results from his policies.He didn’t want to end communism; he was trying to fix it.
I honestly believe if he had been able to stay in power himself, Russia would have gone the way of Germany and Japan, once former expansionist, military tyrants turned peaceful, productive assets to the world.