Records related to an ancestor’s involvement in the military may take the form of service records or benefit records. Service records were those records created during the person’s actual service and relate to their service, when they were mustered in, their physical description, when they were mustered out, where they were assigned, and other information from records created during their service.
Benefit records are records typically created after service related to benefits that were given to or were dur to the serviceperson as the result of their service. Those records, in the United States at least, are typically pension records and sometimes records of bounty lands that were awarded to the serviceman.
In the United States these records are at the National Archives. There may be some additional materials at a state archives or regional facility depending upon the war and the time period.