The OSM data model does not have a concept of areas, or polygons. A line feature ('way' in OSM parlance) that shares the same point ('node') for its start and end is usually considered to be an area. This works well for simple area features like, say, a building.
More complex area features, like ones with holes, large areas, or ones that share edges with other features, are commonly modeled using relations. A relation in OSM is an ordered list of nodes, ways and other relations, or any combination of those.
https://www.openstreetmap.org/relation/198770 is an example of a boundary relation consisting of several ways. The tagging type=boundary and admin_level=6 define the relation as an administrative boundary, and set its level in the administrative hierarchy.
You can find any administrative boundary relation by going to osm.org, entering its name into the search box, and clicking on the relevant result. The info box should say something like "Relation: Salt Lake City (198770)". The integer in brackets is the relation ID. Note that some places are only defined as points in OSM, they won't work in this tool, since it queries for data that lies fully inside the boundary.
There has to be a way to make this easier, but in the time I was prepared to spend on this, I couldn't come up with one.