Basically, sheriffs are cops too. It's not separate. What changes is who's running things and their jurisdiction. A county typically elects its sheriff, and that person leads the department. Plenty of sheriffs also oversee local jails.
Here's where things get confusing.
Law enforcement isn't handled by one nationwide police force. You've got overlapping government layers, starting federally. Federal agencies operate across the country, including the FBI and ATF.
Then you've got states and territories, which cover almost everywhere. They can run their own police organizations. Take Tennessee, where I live. We have both the Tennessee Bureau of Investigation and the Tennessee Highway Patrol, so there's definitely more than one badge in the picture.
Counties come next. Most states divide their territory into counties, though arrangements vary. I'm in Knox County, Tennessee, and we have a Sheriff's Department handling law enforcement throughout the county. The sheriff generally serves as the county's top law enforcement official, commonly chosen by voters in local elections. For anyone living outside incorporated cities or towns, county deputies are often the main cops responding to calls.
Cities and towns add another layer. Many municipalities operate separate police departments of their own. Knoxville is a good example. I live in that city, inside Knox County, in Tennessee, and Knoxville maintains its own Police Department.
So picture something happening on my street. Depending on circumstances, investigators might come from Knoxville Police, the Knox County Sheriff's Department, a Tennessee state agency, or even a federal agency. Several might investigate together.
People often describe the arrangement as federal, then state, then county sheriff, then city police. That's a convenient way to picture the different levels, not a rigid command structure where one automatically bosses another around.
And exceptions? There are loads. Certain city departments patrol entire counties, sometimes even several counties. In such places, the sheriff's responsibilities might mostly involve operating jails instead of regular patrols. Other states and territories barely use counties in any meaningful governmental sense. Massachusetts, yes, I'm looking straight at you. That's why the answer depends heavily on which part of America you're actually talking about.