The Soviet Union was twice as big as Russia. They lost to Afghanistan and collapsed.
Due to the aid such as Stinger missiles we sent. Also, the Afghanistan loss wasn’t the only factor in the USSR’s demise. Saudi’s keeping oil prices low was another key factor, maybe more so.