Dinosaur traces are often in the form of impressions left in mud.
The impression can be of a bone, skin, egg fragment or tooth. Once the mud hardens into stone the impression is preserved... hopefully avoiding erosion from water and wind so that paleontologists get to look at the impression.
Dinosaurs aren't the only fossils found in rocks. All manner of living things can be found if you know where to look. Try going for a walk along a rocky headland next time you're at the beach. If you look into these rocks you can often find impressions of ancient marine organisms.
Just make sure you have an adult with you for safety.