A lot of animals eat only plants, if all the plants die, they would have no food for them to continue life. Also, the animals that don't eat plants wouldn't be able to eat them if they were dead and rotted. Or, they would eventually kill off the rest of the animals that aren't dead yet and would go extinct that way. Once they are all extinct, there would be no more left for the other animals to eat, meaning they would go extinct as well.