Around 2.5 billion years ago early bacteria known as cyanobacteria, started using the sun for phytothinsis releasing oxygen at the same time the earth started cooling causing water vapor to condense creating water. All this happening at the same time created an easy for bacteria to evolve into for complex species to inhabit the earth .
Since earth's early atmosphere was made of dangerous and deadly gasses life could not form. After a while water vapor condensed and formed oceans/ water (important for life), carbon dioxide slowly made its way from under the ground and and out of rocks to the atmosphere. Then early plant forms absorbed the carbon dioxide and started to make oxygen.
Scientists have reconstructed the atmospheric conditions of the early Earth by studying the oldest minerals on our planet. The study provides new data that is important in understanding the conditions. Scientists show that the atmosphere of Earth just 500 million years after its creation was not a methane-filled wasteland as previously proposed, but instead was much closer to the conditions of our current atmosphere. For decades, scientists believed that the atmosphere of early Earth was highly reduced, meaning that oxygen was greatly limited. Such oxygen-poor conditions would have resulted in an atmosphere filled with noxious methane and other deadly gasses. Next scientists discovered that the atmosphere was dominated by oxygen rich compounds found in our current atmosphere.
More than 50 years ago, Miller performed his groundbreaking experiments that showed that an atmosphere containing methane and ammonia could yield amino acids, the building blocks of proteins. Today, many people favor a carbon dioxide-rich atmosphere, but such an atmosphere is much less suitable for producing organic molecules and harder for life forms to thrive.