Once you have the name of your ancestors regiments (which you can deduce from here) you can go to Footnote.comwhere you can find their papers. (Go to Browse>Civil War>Union Soldier Service Records/or/Confederate Soldier Service Records, whichever is appropriate.)
My ancestors were all Confederate and generally the Union, for obvious reasons, had better kept records, especially for the last couple of years of the war, but I had no trouble finding them, even the one whose surname was misspelled. I also found their siblings. For a couple of them the records were very sparse: when they enlisted, when they were paid, blanket issued, etc.- nothing that useful, but for others they were more interesting. One gave me a very detailed description of the ancestor as he was given a medical furlough and it described him in case he was stopped; it also gave the details of his illness (measles and “extreme dysentery”) and his place of death and burial. For another it shows the amount allotted him for use of his horse and an interesting bit about his parole, and for another it explains how my great grandmother was conceived in February 1863 which had been a mystery (he was sent home for 2 months with rheumatism and typhoid). They’re interesting.
One had two brothers who became PoWs in Atlanta and the Union details of their captivity are, perhaps not surprisingly, more detailed than the Confederate details of their service. The Confederacy wasn’t that terribly concerned with keeping all records up to date at the end.
For Union soldiers you can find their pension records there as well or for their widows if they died before collecting. For Confederate pension records, which were paid by the individual states, state archives usually have online databases.
One black lady who I helped with her genealogy was stunned to learn that her g-g-grandfather, a slave in Alabama, had a Union army record. This happened more commonly than many realize: slaves would join the Union army when they could but after the war rarely talk about it because it did not exactly endear them to their ex-Confederate neighbors.
I don’t have the time to pursue it, but it would be interesting to know how many of the black men in that category who remained in the south- and we’re talking conservatively many thousands- collected their pensions. Ot1h it could be the difference in starving and not, but otoh it might be more dangerous than that $12 per month or whatever is worth for the blabbermouth small town post office manager to know you get a U.S. military pension check (hence you might well be the person who killed his uncle/brother/pa).