Ultimately the question is unresolved, as there were no human witnesses to the creation.
In elaboration of previous comments that the text of Gen 1 is attributed to the priestly tradition, the Jewish commentaries point out that text is highly poetic, with extra repeated words for poetic effect (apparently).
The Jewish Publication Society commentary on Genesis points out that in the first creation account, the Hebrew verses are either seven words in length or a multiple of seven Hebrew words.
So, that literary analysis blows wide open the subject of the significance of the number 7, in my view underscoring how Gen 1 points to the creation of the Sabbath rest in the first seven days.
A catholic author and theologian describes Gen 1 (the first creation account) as like a great hymn of introduction, underscoring the poetic and priestly liturgical form of the writing. It’s like an overture of the Bible (that’s the word I was looking for.)
The JPS commentaries look for harmony everyplace in scripture. So, they rationalize that the two creation accounts represent different traditions. To avoid having to choose between them, they were included together. I think these commentaries say that the account of Noah’s flood consists of three different accounts interwoven, if I remember correctly.
A previous post describes how days 1-3 represent the creation of domains, generally in a state of chaos, which were then put into order on days 4-6. That’s not a scientific explanation, as it was never intended to be. It is a theological explanation.
A high percentage of the OT is poetry – inspired poetry at that. Analogously,the NT commentary that I’m reading now about the gospel of John notes that “something” happens, like the “word was made flesh and dwelt among us” which tells us a truth, but does not tell us the “how” – like how light was created on the first day or how God took on flesh. Early scripture commenters like St. Augustine say that we will never understand the “how” of scripture.