Thank you for posting your question to History Hub!!
We can suggest some of the following guides to assist in your research but it appears you have already started the journey to discovering your family’s history. National Archives Catalog Guide for Genealogists and Historians https://www.archives.gov/research/genealogy/catalog-guide You can also enter your Grandfather's name in the search box at https://catalog.archives.gov/ but it is also possible that you may want to use Ancestry.com (a fee based web site) to locate the records you seek or Familysearh.org (requires a login and password but free to use).
We did however locate the following information for the name “McGary, Edward” from Record Group 94: Records of the Adjutant General’s Office, Indexes to the Carded Records of Soldiers who Served in Volunteer Organizations During the Civil War, McGary, Edward: Unit 17th Calvary, Company B, Pvt. McGary (McGarry) Edward. https://catalog.archives.gov/id/49642141 If you notice, there is a name correction from McGarry to McGary. These variations occur and we then entered the name “Mcgarry” into the Office of the Illinois Secretary of State: Illinois Civil War Muster and Descriptive Rolls Detail Report web page and located an entry using this search box: https://www.ilsos.gov/isaveterans/civilMusterSearch.do These military records may assist in your search by using the surname “McGarry” as well as “McGary”.
The Office of the Clerk White County, IL may also hold records related to your research
Finally, you may want to contact the Office of the Illinois Secretary State Illinois Regional Archives Depository or (IRAD) for records related to your search.
Due to the COVID-19 pandemic and pursuant to guidance received from the Office of Management and Budget (OMB), NARA has adjusted its normal operations to balance the need of completing its mission-critical work while also adhering to the recommended social distancing for the safety of NARA staff. As a result of this re-prioritization of activities, you may experience a delay in receiving an initial acknowledgement as well as a substantive response to your reference request from Textual Reference (RDT2). We apologize for this inconvenience and appreciate your understanding and patience.
We hope this is helpful. Best of luck with your research!
Leo L. Belleville III