Usually the shape of the bone tells you what body part it is. Mostly scientists don't put dinosaurs back together. It's too expensive, the bones are too valuable for studying, and you rarely get a complete skeleton anyway. The fact that dinosaur skeletons look so much like the skeletons of birds is one of the things that makes it possible for us to put their skeletons together properly. We also occasionally find complete skeletons, with every bone in place, so there is not much doubt how most of the skeletons go together.
Most skeletons have several hundred individual bones.
When the first ones were discovered, scientists were not sure how they went back together until they discovered the resemblance to birds. Sometimes if the bones are pretty badly broken up it's hard to tell what animal they belonged to. Usually you can tell pretty well what kind of dinosaur made them, at least to the level of what family or group of species. But you need a bone that is diagnostic, which means you can tell by its shape alone what animal uniquely had it, to be able to figure what animal produced the fossil. You tell the rock's age by small fossils of plants and little animals that we already know the age of, or by chemical testing if it is volcanic rock.