Islam commands that one’s environment must be cared for and protected, and thus Islam forbids polluting it in any way. It does so through the following means:
It encourages planting beneficial plants and trees. The Messenger of Allah, Muhammad said: “No Muslim plants a tree or crop, and its fruit is eaten by birds, people, or animals, except that it will be regarded as charity for him.” (Bukhari)
It encourages the removal of anything that may inflict harm. The Messenger of Islam said: “Removing harm from the path is an act of charity.” (Bukhari)
It encourages quarantining those afflicted with diseases and epidemics in order to prevent its spread to other societies and protecting the lives of others. The Messenger of Allah said: “If you hear of a plague in a certain location, then do not enter it, and if it strikes a place where you are, then do not leave it.” (Bukhari)
It forbids the random killing of animals and birds. The Messenger of Allah, Muhammad said: “Whoever kills a sparrow for no reason, it will cry to Allah on the Day of Requital, ‘O Allah, so and so killed me without reason or benefit!’” (Nasa’i)
It forbids polluting the society in any way. The Messenger of Allah, Muhammad said: “Fear two things for which people curse others for.” [His Companions] asked, “What are the two things for which people will curse others for, O Messenger of Allah?” He replied, “That he relieves himself in places where people walk or where they seek shade.” (Muslim)