"In the beginning, God created the heavens and the earth. The earth was without form and void, and darkness was upon the face of the deep. And the Spirit of God was hovering over the face of the waters."
It is impossible for us, as finite human beings, to imagine a time when there was no earth, planets, space, or even time itself. But that is the image that Genesis 1:1-2 gives us. Here we see the only thing in existence: the Triune God.
The Bible begins with a very dogmatic sentence: "In the beginning, God created the heavens and the earth." At the beginning of time, it was God who both physically and literally created the heavens and the earth. This creation was a physical work of God because we read a few verses later that by His direct word the universe was created (v. 3). This creation was also literal in that these verses are not metaphors, analogies, or any other figure of speech. This is a narrative of a true event in history. It happened just as we read. We know this because of God's use of repetition throughout the first chapter. For example, each day's creation begins with "And God said", and ends with "And there was evening and morning".
During this time, the earth had no shape or contents. Our finite minds want to make a representation of it, but that is impossible because the earth had neither shape nor color (v. 2). John Gill, in his Exposition of the Entire Bible, writes that the creation "was a fluid matter, the watery parts were not separated from the earthy ones; it was not put into the form of a terraqueous globe it is now, the sea apart, and the earth by itself, but were mixed and blended together; it was...a waste and desert". Although we can only surmise what the earth looked like at this point, we do know that there was darkness all around, according to chapter two.
We also know that the Trinity was present in creation as well. In verse two, the Spirit of God is pictured as hovering over the newly created waters. Later on, the Trinity is active in the creation of the first human beings (1:26-28). Furthermore, in the first chapter of John, the apostle writes that the Son Himself was present and active in creation. John goes to great lengths to show that, not only was the Son present, but He is actually God and that "All things came into being through Him, and apart from Him nothing came into being that has come into being" (John 1:3). It sounds repetitive, but that is John's point. Just as Moses, the author of Genesis, used repetition to show the creation of the world by the direct act of God, so too does John use repetition to show that the Son, Jesus Christ, was present and active in creation.
It is comforting to know that no part of creation has escaped the attention of God, the Spirit, and the Son. And not only did these Beings create the universe, but they were, and are, present in the activity of the earth.