How common were sheriffs in the Wild West (1870-1890ish)? Did every town have a sheriff? Was it a county thing? Was there only one sheriff and a bunch of deputies? Thank you.
A sheriff is an elected or appointed law enforcement official for a county; a county is a governmental entity responsible for a defined plot of land granted authority by either a territorial or a state government.
Each county would have a sheriff, who depending on the budget could have a number of deputies. Deputies could assist the sheriff county wide or be assigned to specific smaller communities.
Within a county, some communities could incorporate as cities. These usually had their own police force which had jurisdiction for the city, excluding the sheriff from jurisdiction unless the local governments had a cooperative agreement allowing sheriff jurisdiction within the city.
In addition, federal marshals were assigned to various regions, but especially to territories where local governments hadn't established themselves adequately to provide law and order.