The Big Bang where it all began!
The Big Bang theory is the nearest explanation we have to the origin of the universe. It describes how Earth was formed about 14 billion years ago.
The Big Bang was not actually a 'bang' as such, more like 'the simultaneous appearance of space everywhere in the universe' in which an extremely hot and dense state was followed by rapid expansion of the universe. The universe continues to expand, now and into the future.
At the time of the bang, clouds of hydrogen and helium were formed, creating the first stars, planets, solar systems and galaxies. But this infant universe cooled and dispersed too quickly for heavier elements to form. We therefore need another mechanism to form the elements of which Earth is made.