How do we know dinosaurs walked the earth millions of years ago?
To answer this question, one has to approach it from two parts:
1. How do we know dinosaurs existed?
We know that dinosaurs (and other extinct animals and plants) existed because of the fossils they left behind. Their fossils come in many types, from preserved bones to tracks and more. Some fossils are better preserved than others and show impressions of skin and other soft tissues. Because of their remains that they have left, we know that dinosaurs existed, much like how we know the ancient Egyptians must have existed because they left the pyramids.
2. How do we know how old they were?
You may wonder how we know that these fossil remains are millions of years old! The answer is we use a method known as radiometric dating. We know that radiometric dating is reliable because it gives results which agree with nonradiometric dating methods (geography/geology, astronomical observations of the earth's rotation, relative dating methods, luminescence dating methods, etc etc etc) and because radiometric methods typically give consistent results despite using independent and different methods .
Some online resources about radiometric dating-
Radiometric Dating and the Geological Time Scale: Circular Reasoning or Reliable Tools? by Andrew MacRae -- http://www.talkorigins.org/faqs/dating.html
Age of the Earth: Radiometric Dating -- http://www.gate.net/~rwms/AgeEarth.html
United States Geological Survey -- Radiometric Time Scale --http://pubs.usgs.gov/gip/geotime/radiometric.html
Wikipedi article points to many many qualified sources--http://en.wikipedia.org/wiki/Radiometric_dating#References