The Truman Doctrine went far beyond what most people think, it was not simply some plan about aiding countries facing communist insurgencies. The doctrine did involve military aid, but also life-enhancing programs such as engineering projects, agricultural projects, health care, the full range of aid programs. It also did involve the Marshall Plan, but the most important long-range part of the plan was the doctrine of Containment.
This did not involve only aiding countries against invasion (such as the Greek-Albanian War and the Korean War), insurgencies (a myriad of wars from the Malaysia Insurgency on) and situations involving both (such as Vietnam and the Soviet-Afghan War). The long term plan was to keep the wars as small and contained as possible, which was most difficult in Vietnam, and to gradually economically wear down the USSR. Essentially, from 1947 through the 1980s the "World Revolution" proceeded at a pace and a cost which drove the Soviet economy into a state of disaster. The Afghan war was the final nail in the coffin, so to speak.
By the mid-70s the probability of war between the US and USSR was really low, and the proxy wars seemed to be going fairly well for the Soviets. It was a trap, basically. In the '80s the process in Central America was to adjust our aid to just above what the communists could deal with, prompting them to pour in more men, material and materiel to top that, then we would add a little more, all the time using our economic might, international credit and diplomacy to keep a lid on the possible size of the wars. Same in Africa, etc. With the increase in costs, the Russian economy began to falter. The French destroyed unknown millions of dollars worth of tanks and aircraft Libya still owed the Soviets for, as an example. The Israeli invasion of Lebanon seized enough Soviet weapons to arm several divisions, hundreds of thousands of soldiers, an indication that the USSR was stockpiling weapons in the Middle East in the hopes of an eventual invasion; the PLO could never raise a fraction of the troops to use them. The Syrian Army, which had invaded Lebanon earlier and held the eastern part of the country, had so many Soviet "advisers" that some front-line units were 10% Russian. If you have a fifty-thousand dollar missile and use it to kill a million dollar tank, you're winning. If you convince your enemy to use billions of dollars for weapons easily destroyed in the hands of third parties, or never even used, that's even better.
With the war in Afghanistan, the Soviet Union reached its breaking point. With the collapse of morale in the army and faith in the government at home, combined with the economic strain of the war, the end came. By the mid-80s the USSR was doomed; two books came out at the time, one written by Richard Nixon, declaring that for all practical purposes the Cold War was over, and the Soviets had lost. The final collapse was simply a matter of the politicians realizing the truth and scrambling for whatever future they could set up for themselves and their country.
And all of this, which so many like to pretend was some magical effect of Reaganism, was accomplished by following the principles of Containment, and the Truman Doctrine.