Ecology is the scientific study of the interaction between lifeforms and their environment, usually, on a planetary scale. The term can also be used to refer collectively to the animals, plants and other lifeforms and the environment of any given area.
In the 23rd century, the times of the 20th and 21st century were seen as having an overall negative effect on the ecology of the planet Earth. In particular, the extinction of the humpback whale due to hunting and habitat pollution was perceived as one of the major mistakes of Human civilization's mistreatment of their planet.
When the HMS Bounty traveled back to 1986, Spock was able to determine the approximate time period of their arrival based on the high levels of pollutants in Earth's atmosphere. (TOS movie, novelization & comic adaptation: The Voyage Home)
The USS Enterprise-D brought relief supplies to planet Tagra IV in the Argolis Cluster in 2369 because the ecology of that world had been devastated by the Tagrans' industrial activity. (TNG episode: "True Q")