Once you realize that Afghanistan had almost zero to do with the end of the Cold War - and in fact may have prolonged it then funding the Islamist stupidest thing the West ever did since the idiot Crusaders allowed the jihadi Mameluks to pass through Aleppo and attack the anti-Muslim Mongols.
The Mongols wanted to do a deal with the Western Crusaders to destroy the Muslims but the Crusaders feared the devil they did not know and made a deal with the jihadis. Once the jihadists won against the Mongols they turned on the Crusaders and wiped them out from the Middle East. History repeats itself (Russians being the Mongols this time and the USA being the dumb Crusaders in the Middle East).
The Soviet defeat in Afghanistan had a substantial role in ending the USSR in that it shook the confidence of the leadership and discredited the regime with the Soviet public. And after Afghanistan proved that the Soviet conscript army could not subdue tribesmen living in mud huts, that same army became a doubtful instrument to enforce Soviet rule in occupied Eastern Europe. An empire may long survive even though hated and thought to have internal weaknesses, but its end is in sight when its weakness is revealed.
While Europe and the US have far more to lose, Islam is a more immediate threat to Russia. And while Putin may be the big man in the Kremlin for the rest of his life, he is not immortal. Worse, the Putin regime has no solution against Islamic aggression except to ally with pliable Muslim thugs and dictators; and as Putin's vitality declines due to age, a Brezhnev style era of corrupt stagnation seems inevitable.
Meanwhile, the US and the West are showing signs of rallying against Islamic terrorism. The American public especially seems to be nearing the limit of its acceptance of Muslim aggressiveness. And, with the illusion of Muslim democracy having worn thin, sterner measures seem likely to be restoted to.