Nicknamed "Fightin' Dick," Anderson was the grandson of the Revolutionary War hero Richard Anderson. He graduated from West Point in 1842, ranked 40 out of 56. After graduating, he attended cavalry school at Carlisle, Pennsylvania. After serving with the Dragoons in the West a, he fought with them in the Mexican War, in which he was brevetted 1st lieutenant "for gallant and meritorious conduct in combat."
In December 1860, when South Carolina seceded from the Union, Anderson resigned his captain commission and became Colonel of the 1st South Carolina Infantry.
He fought at Fort Sumter and succeeded Brigadier Gen. P. G. T. Beauregard in command at Charleston in July 1861. In July, he went to Pensacola, Florida to join as Gen. Braxton Bragg. Anderson became Bragg's top assistant in August. In 1862, Anderson commanded Longstreet’s Division at the battle of Seven Pines, Gaines' Mill, and Malvern Hill, commanded Anderson’s Brigade/Longstreet’s Division in the battle of Seven Days, and commanded Anderson’s Division/Longstreet's Corps at the battles of 2nd Bull Run, Antietam, Fredericksburg, Chancellorsville, Gettysburg, and the Wilderness. After Gen. James Longstreet was wounded, he led II Corps at the battles of Spotsylvania, Cold Harbor, and the battles around Richmond. When Longstreet returned to duty, Anderson was put in charge of part of the Richmond defenses.
Anderson was much admired by Gen. Robert E. Lee. At the Battle of Sayler's Creek, Anderson's commanded Bushrod Johnson’s Division in the rear guard action. His command was scattered, and he barely escaped capture. Although he returned to Richmond, Virginia, there was no command commensurate with his rank, so he was relieved as supernumerary the day before Lee's surrender.
Anderson failed as a planter back in South Carolina. He spent his post-war years in poverty, at one time becoming a day laborer.