If it were any farther from the sun, the planet might have been too cold to support life. If it were any closer to the sun, it might have been too hot to support it life. Thankfully, we are just the right distance from the sun and thanks to the development of the atmosphere we are protected from the cold exposure of space. This thin layer of gases is akin to the candy coating of an M&M. Relatively speaking, the entire shell of the M&M would be the atmosphere of earth, the coloring on the outer most side of that candy coating would be the ozone layer. Without that coating, the M&M would surely not melt in your mouth instead of your hand, but would instead melt long before you put it in your mouth. The same is true with the Earth and its atmosphere.
To begin, the best thing to do is to become familiar with certain terms and their definitions to have a better understanding. First of all, the atmosphere is the thin layer of gases which prevents and protects from the impacts of such things as meteors as well as that which provides the necessary gases for life. Importantly, it also works to protect us from ultraviolet light. The ozone layer is made of molecules of ozone, which is described as O3. Another term that will be discussed is chlorofluorocarbons (CFCs). CFCs are chemicals, used in the past in aerosol cans for example, that are greenhouse gases.
The first major signs that something was wrong were discovered in 1985. That year, scientists noticed in the atmosphere above Antarctica something they termed the "ozone hole". This wasn't a hole, per se, but instead a thinning of the ozone in that region. As time passed, it was discovered that CFCs and other ozone depleting substances were causing this thinning of the ozone layer to occur. CFCs of the time were coming from the use in more developed countries of aerosol cans, such as the ones that were formerly used for things such as hair spray and cleaning supplies.