Ancestry has a large number of collections for Military records in the United States.
The 2 collections I have used at this stage are
A full list of the collections Ancestry holds can be found by searching the Card Catalogue.
The National Archives holds Federal military service records from the Revolutionary War to 1912 in the National Archives Building in Washington, D.C. See details of holdings.
Military records from WWI – present are held in the National Military Personnel Records Center (NPRC), in St. Louis, Missouri, See details of holdings.
The National Archives does not hold state militia records. For these records, you will need to contact the appropriate State Archives.