Here is one source of that information. familysearch.org is free but you need to register to use.
If you google "civil war service records" you will find other websites that you can check out.
Good Luck in your search.
Dear Mr. Chavez,
Thank you for posting your request on History Hub!
We searched the National Archives Catalog and located the series Carded Records Showing Military Service of Soldiers Who Fought in Volunteer Organizations During the American Civil War in the Records of the Adjutant General's Office, 1762 - 1917 (Record Group 94) that include the service records persons who fought in volunteer units during the Civil War. Some of these records have been digitized and are available using the Catalog, to include records for soldiers in New Mexico volunteer units.
We also located the series Enlistment Papers, 1798 - October 31, 1912 and Registers of Enlistments in the United States Army, 1798 - 1914 in Record Group 94 that include military service files of enlisted soldiers of the Regular Army. These records have not been digitized. In addition, we located Letters Received, 1863 - 1917 (documenting 1850 - 1917) in Record Group 94 that includes letters, reports, and papers relating to the military service of officers of the Regular Army, officers of Volunteers in the Staff Corps commissioned by the President, and officers commissioned by brevet appointment in the Regular Army and Volunteer organizations. Portions of these series have been digitized and are available using the Catalog.
Plus, there are pension records for some soldiers, the majority of which have not yet been digitized.
To order records that have not already been digitized, please fill out a NATF Form 86 for the service records and a NATF Form 85 for the pension records and mail the completed forms to the address listed on the form. You also may place your order online using eservices.archives.gov. For more information see Requesting Copies of Older (pre-WWI) Military Service Records.
Lastly, the National Park Service’s Civil War Soldiers and Sailors System (CWSS) is a database containing information about the men who served in the Union and Confederate armies during the Civil War.
We hope this is helpful. Best of luck with your family research!