There are few different theories about this but the most popular one is that they were killed when a massive asteroid hit Earth. When it hit, it kicked up so much dust into the atmosphere that light from the sun was blocked out and the atmosphere became poisonous. Almost all of the dinosaurs died out, but some animals, like crocodiles, are relatives of the dinosaurs and are alive so some things managed to survive.
The evidence for it being a meteor hitting Earth, rather than a volcano erupting or something, is that the Chicxulub Crater in Mexico is known to have been created around the same time as the dinosaurs went extinct. So the asteroid probably hit Earth there.
The last dinosaurs died around 65 million years ago. Their extinction is still a mystery, climatic change, diseases, changing plant communities, and geologic events could all have played a role.
Where Did All The Dinos Go? Here are Some Leading Theories
1)A big meteorite crashed into Earth, changing the climatic conditions so dramatically that dinosaurs could not survive.
2) Ash and gas spewing from volcanoes suffocated many of the dinosaurs.
3) Diseases wiped out entire populations of dinosaurs.
4) Food chain imbalances lead to the starvation of the dinosaurs.
we were asked this in the live chat today as well. Ian and Hannah have covered the bases. I learnt about this in my geology degree at University. Current favourite theory is a giant meteorite impact throwing up lots of dust and obscuring the sun but the different theories come into and go out of fashion as there is no definite evidence that any were right.