Everything that makes upt he universe was once in a small clump of matter that, for reasons yet unknown, exploded outwards. The universe is still expanding, because the momentum of the matter particles is still carrying them out.
Earth formed, liek many planets, as a dense ball of dust, which hardened over time into rock. For a couple billion years, the earth was a volcanic rocky ball orbiting the sun...but, then, an amazing thing happened. Supposedly, ice meteors crashed into the surface, creating massive craters which were filled by the melted ice of the ice meteors, thus forming oceans. It is in this that energy and matter clumped together to form the first bacterium- the first organisms.
These evolved, over billions of years, to multicelled organisms, such as plants, fish, etc...and later amphibians and reptiles, some of which split off to become reptile-mammals, which evolved into mammals- rodents, mostly. After a few mass-extinctions, hominids became dominant, evolving into apes and humans eventually.