Let's talk about the Word of God.
Genesis 1:1-3 NRSVUE
[1] When God began to create the heavens and the earth, [2] the earth was complete chaos, and darkness covered the face of the deep, while a wind from God swept over the face of the waters. [3] Then God said, “Let there be light,” and there was light.
Where in the first chapter of Genesis does it say anything about the earth coming into being? The beginning is "when" God began creating, not the time in which the earth came into existence.
Or some people prefer this translation:
Genesis 1:1-3 NRSV
[1] In the beginning when God created the heavens and the earth, [2] the earth was a formless void and darkness covered the face of the deep, while a wind from God swept over the face of the waters. [3] Then God said, “Let there be light”; and there was light.
But still, in the beginning when God created the heavens and the earth, the earth was [already] the earth was formless and empty.
But it was there, already. It was just formless. In the beginning when God created it.
Indeed, the text even tells us when God created it. It wasnt even in verse 1, rather, it was on the 3rd day:
Genesis 1:9-10 NRSV
[9] And God said, “Let the waters under the sky be gathered together into one place, and let the dry land appear.” And it was so. [10] God called the dry land Earth, and the waters that were gathered together he called Seas. And God saw that it was good.
This is where God created the earth. And it was good.
And when did God create the heavens?
Genesis 1:6-8 NASB2020
[6] Then God said, “Let there be an expanse in the midst of the waters, and let it separate the waters from the waters.” [7] God made the expanse, and separated the waters that were below the expanse from the waters that were above the expanse; and it was so. [8] God called the expanse “heaven.” And there was evening and there was morning, a second day.
That's right. God created heaven on day 2. Not in verse 1.
The catch is that both heaven and earth were already there. The earth was there and God simply moved the waters off of it so that the dry land would appear. And heaven was already there too, God just expanded it between the waters and moved the waters out of the way (kind of like what God did with the read sea, separating waters from waters).
And remember, God creates with the spoken word. Literally every creation day begins with "God Said":
Genesis 1:6, 8-9, 13-14, 19-20, 23-24, 31 NASB2020
[6] Then God said, “Let there be an expanse in the midst of the waters, and let it separate the waters from the waters.”
[8] God called the expanse “heaven.” And there was evening and there was morning, a second day.
[9] Then God said, “Let the waters below the heavens be gathered into one place, and let the dry land appear”; and it was so.
[13] And there was evening and there was morning, a third day.
[14] Then God said, “Let there be lights in the expanse of the heavens to separate the day from the night, and they shall serve as signs and for seasons, and for days and years;
[19] And there was evening and there was morning, a fourth day.
[20] Then God said, “Let the waters teem with swarms of living creatures, and let birds fly above the earth in the open expanse of the heavens.”
[23] And there was evening and there was morning, a fifth day.
[24] Then God said, “Let the earth produce living creatures according to their kind: livestock and crawling things and animals of the earth according to their kind”; and it was so.
[31] And God saw all that He had made, and behold, it was very good. And there was evening and there was morning, the sixth day.
And when is the first time God speaks and the first thing He creates?
Light. Not heaven and earth