Tragedy of the commons occurs when there is a common resource (especially, erodible → decreasing stock level past a threshold decreases regeneration rate and/or outflow).
In such a scenario, every actor benefits by using the resource more. (Because each actors gets full benefit from using the resource, but cost of doing so is shared by all actors.) However, increased usage wears off resource faster, which leads to collapse.
(An example is a common pasture. Every shepherd benefits from growing his herd, but downturn of increasingly scarce grass is shared by all shepherds.)
Ways to fix:
Educate everyone about dangers
Privatize, so every actor bears full cost of his own actions (and actors do not suffer from actions of other actors)
Regulate—create law, mutual coercion