And what drugs did they do? Weed? Opium?
The substance of choice for soldiers in the north as well as south during the war was alcohol. Following the war, many veterans on both sides suffered from morphine addiction, largely as a result of it being prescribed to the wounded during recovery. The level of addiction for Civil War veterans is a hotly debated topic, however, largely because some theorize that its prevalence was overblown by the U.S. government in their attempt to outlaw opiates, etc.
First, the alcohol. Although it wasn't an epidemic by any means, drunkenness was indeed a problem for many armies during the war. Gen. George McClellan found it to be such a problem that he famously stated:
"No one evil agent so much obstructs this army in its progress to that condition which will enable it to accomplish all that true soldiers can, as the degrading vice of drunkenness. It is the cause of by far the greater part of the disorders which are examined by courts-martial. It is impossible to estimate the benefits that would accrue to the service from the adoption of a resolution on the part of officers to set their men an example of total abstinence from intoxicating liquors. It would be worth 50,000 men to the armies of the United States. (Gen. Orders No. 40, Feb. 4, 1862.)"
This was probably a little bit of an exaggeration, and partly the product of McClellan's overall disdain for the shape the Army of the Potomac was in when he took command following Bull Run. Still, it bears mentioning. In the south, although alcohol was indeed available, it seems to have been more of a luxury, and less of an issue when it came to the problems their armies faced. Again, though: this can be taken with a grain of salt, as the Confederate army had a host of other problems depending on where you're looking (shortages of food, and/or ammo, clothing, footwear, horses, medical supplies plagued many of the armies in the field). I'm not immediately aware of any primary sources from the Confederate side that speak to the prevalence or level of hassles the army experienced due to widespread alcohol consumption.
In the Union, privates and everything in between all the way up to generals had documented issues with alcohol. Brigadier General Edwin H. Stoughton was captured by Mosby and his raiders after getting blitzed at a champagne party. Also in the north, the guy who was supposed to command and direct the Union attack during the Battle of the Crater got drunk and his men were slaughtered (Brig. Gen. James H. Ledlie).
Following the war, as mentioned, the biggest substance problem for veterans was morphine addiction, as you had thousands of soldiers with no education or previous exposure to opiates fall victim to their addictions. This was a very real problem up to the start of the 20th century, and ruined a hell of a lot of lives. The addiction was later called the "Soldier's Disease" and although few numbers attest to actual figures that can be verified (to my knowledge, the government never commissioned a study on the effects of morphine addiction for living Civil War veterans), some estimates put the figure as high as 50-75,000.
[Sources: William White, 'Slaying the Dragon: The History of Addiction Treatment and Recovery in America'; Bruce Catton, 'Mr. Lincoln's Army'; Shelby Foote, 'The Civil War, vol. 1']