Armies tend to keep pretty good records of their soldiers, and they have done so for centuries. That's why both professional genealogists as well as casual family history researchers love getting access to military record databases. Here's how to research military records for your family.
Start With WWII Records at NARA
The National Archives and Records Administration -- NARA -- has some awesomely huge databases that are available online. These include more than 9 million World War II enlistment records. Though the NARA databases aren't the easiest lookups to use, they are chock full of information, including name, rank and serial number (of course) along with date and place of enlistment, height and weight, marital status, and a host of other details.
Check Your Civil War Ancestors
Want to know what a massive conflict the Civil War was?
The Civil War Soldiers and Sailors System (CWSSS) includes the name of six million Union and Confederate soldiers and sailors who served during the War Between the States. This was at a time when the entire population of the US was only 32 million -- about one out of every five people in the country fought in the Civil War!
The CWSSS will identify individual soldiers, along with the unit they fought with.
Examine Veteran Gravesite Records
The Department of Veterans Affairs has created a Nationwide Gravesite Locator, where you can lookup the gravesites of veterans from all wars and all military services (Army, Navy, Marine Corps, etc).
There is a separate lookup database for overseas burials for veterans.
Check State Archives
All states keep historical records in state archive collections, and much of this material is finding its way online.
The archives include military records for major conflicts from the Revolutionary War, the Civil War, and up through World Wars I and II, Korea and Vietnam. But they also include many lesser-known actions, like the Spanish-American War, Indian Campaigns, or the "Mexican Emergency" (going after Pancho Villa).
Check DigitalStateArchives.com as a good source of state archive information you can find online. Consider making a visit to the offline archives in the states where your ancestors lived.