Priests and ministers of most Christian denominations kept records of baptisms, which often mentioned the birth date, marriages, and burials, which often mentioned the death date.
Counties kept records of wills & probate, & deeds for property, mostly but not exclusively land, as well as records of civil criminal cases, at the country courthouses.
Various colonial, local, state, and federal courts kept records of naturalizations, as well as civil and criminal cases.
All private and government bureaucracies kept some records of various events. So large companies, church organizations, municipal, county, state, and federal governments, and maybe some tribal governments with higher than usual literacy rates, and maybe other types of organizations, all had smaller or larger archives.
Most states and territories began keeping vital records of births, deaths, and marriages in the late 19th and early 20th centuries. There were some earlier examples.
For example, the City of Philadelphia began keeping vital records about 1810 if I remember correctly, while the City and County of Philadelphia began a new series of vital records in 1860.
Directories for many cities and towns were published by printing companies listing names, addresses, and occupations of adult residents, as soon as there was a market for them and until phone books began to be published.
The federal government of the USA conducted an annual census every ten years beginning in 1790, and some colonies, territories, and states had censuses at other times.
Newspapers often kept files of back issues.
I suspect that access to some archives was sometimes much more difficult in the 19th century than in the present, since governments often didn't have as centralized archives as today, travel was harder, there were fewer historical societies to collect various records, and there was no internet.
in fact, I am using 19th century difficulties in access to records as a plot point in a story.
In the campaign resulting in the Little Bighorn in 1876, General Terry and his superiors Generals Sheridan and Sherman, and his subordinates Custer, Gibbon & Brisbin, were afraid that the hostile faction of Sioux and Cheyenne would run away and/or disperse into smaller bands if they detected the soldiers approaching and the campaign would become a long and tedious effort of chasing down many different bands.
They were obsessed with the idea that they had to surround the hostiles to capture them all at once. They believed that the hostiles would retreat if they detected a regiment approaching.
But in fact during a Sioux war during the Civil War Sioux warriors had ridden out several times to fight against approaching brigades, not mere regiments, of soldiers.
By 1876 there were three main factions of Teton Sioux. One faction lived in the wild all year, one faction lived on the reservations all year, and another faction lived on the reservations during the winter and let the reservations to hunt in the summer. Thus in summer there would be thousands of Sioux warriors roaming the hunting grounds where the hostiles lived all year, and it was perfectly possible for enough warriors to join together to stand and fight against a brigade, let alone a mere regiment, just as they did during the Civil War.
So my story will involve a sinister plot by unreconstructed Rebels to cause the US army to be badly defeated by the Sioux in the hope that will spark another Southern Rebellion, uprisings by other tribes, and intervention by European Powers. Various plotters try to convince the army leaders that the Sioux aren't as dangerous as they actually are. And possibly a character who suspects the truth will visit various War Department offices scattered around Washington looking for the reports about the battles with the Sioux during the Civil War.