The non-God answer:
The Big Bang with inflation and more to produce the universe we have.
The God answer:
Genesis 1:1-2. Verse 2: “the earth was without form and void, and darkness was upon the face of the
deep, and the spirit of God moved up the face of the waters.” In the Bible, this creation of the universe and of matter
happened before light entered the universe (verse 3).
First, we read and believe the first two verses as understood today:
“In the beginning, God created the heavens” this is the space-time universe, and “ … and the earth” this is matter.
Matter before light is described to be “without form and without energy” and as “water”.
(Think of a ball of the dense element Mercury.) I define matter to be a large, dense ball of all the initial ‘stuff’ such as quarks, gluons, and electrons.
Also, “the spirit of God moved upon the face of the waters” … that looks important,
but I do not know what it means.
When light was added in verse 3, energy was added and matter became alive.