I wish I could go back in the time and see how the Earth was formed. Obviously, this is not possible.
Humans has always been curious about to know origin of the earth. We have lots of theories and hypothesis about the origin of the earth, but the initial written documents are religious texts. Religious texts do have theories of origin of the earth, but they do not satisfies us how this happened. It is certain that the Earth is a part of the Solar System and our existence is also connected to this Solar System.
Many scholars have tried to know about the origin of the Earth and according to the knowledge present in their time, they have presented their own theories and hypothesis.
We don't know how the evolution and the origin of this universe and the earth took place but we select the best or most appropriate hypothesis that solves all our doubts. We can divide these theories into two parts, (i) Early Theories and (ii) Modern Theories.
Although early theories are not perfect, but they made the foundation for modern theories.
(i) Early Theories
(ii) Modern Theories
(a) Big Bang Theory
You should also read Interior of the Earth