How did they get soldiers for the civil war?

It was a volunteer army. some as young as 12. People believed in real American causes.

However, by 1863 the Union instituted the draft for the first time. Most of the recruitment was still of volunteers. Many immigrant families also sent one or more men into the army either to provide a source of income or in exchange for citizenship.

The Confederacy placed a general conscription order on all able-bodied free white males during the last two years of the war. Most of the army was still volunteer.