All dinosaurs, except a few which would later go on to become modern birds, went extinct about 65.5 million years ago, during the Cretaceous-Tertiary extinction event. No land animal larger than a cat survived. The sky was largely blacked out for a period of years to decades, killing numerous plant and microbe species which rely on photosynthesis to survive. Species that depended on the consumption of plant matter, such as all vegetarian dinosaurs, went extinct when their food sources died off and decomposed. In North America alone, 57% of plant species went extinct. In paleontology, the layer of rock that corresponds to this extinction is known as the K-T boundary.
Even today, we don't know with 100% confidence what really caused this massive extinction. But the prevailing theory, by Nobel Prize-winning physicist Luis Alvarez, is that a 6-mile asteroid impacted the Earth, releasing the energy of 2 million atomic bombs and raining molten magma across the entire surface of the planet.
Alvarez's extinction theory is supported by two facts: first, the huge Chicxulub crater on the Yucatan peninsula in Mexico can be dated to the time of the K-T boundary. Second, all across the world, the K-T boundary rock contains an unusually high proportion of iridium, a substance very rare of the Earth's surface, but more plentiful in asteroids. This suggested that the debris from the impact fell everywhere on the globe. This illustrates the destructiveness of the impact. The rock underneath the crater is rich in gypsum, which would have produced clouds of sulfur dioxide aerosol in the aftermath of the collision, resulting in acid rain and killing marine creatures that depend on their shells for survival.
Being very large and exposed on the surface, as well as more highly dependent on smooth ecosystems than less specialized plants and microorganisms, dinosaurs were hit with the brunt of the extinction effects. The Chicxulub asteroid slammed into the Earth at an angle, traveling northwest. This would have thrown magma-hot, ballistically reentering ejecta all across what is today the central United States, an area known for its large dinosaur populations.
The direct effects of the heat could have killed off 99% or more of the dinosaurs within hours. Those who were able to survive the rain of magma would die over the next years or decades, their food sources drying up, and ecosystems becoming completely unraveled. Life would never be the same again: from that point on, it was not the dinosaurs, but smaller warm-blooded animals that would thrive on planet Earth.