This extinction seems to have been caused by two quite different things. One was a great series of volcano eruptions in what is now the Deccan area of India. These volcanoes belched vast quantities of gases into the air, poisoning the atmosphere all around the planet and causing many animals to die including, especially, the dinosaurs. The reason seems to have been that all the poisons in the air killed off many of the plants so that the dinosaurs simply died of starvation.
The other thing was a giant asteroid or comet which slammed into the Earth and blew up, throwing huge amounts of water vapour and dust high into the air. This messed up the world's climate and destroyed the protective ozone layer which shields life from the sun's harmful ultraviolet rays from the sun.