The Bible doesn't actually say that. It says this:
Ecclesiastes 12:7 KJV
Then shall the dust return to the earth as it was: and the spirit shall return unto God who gave it.
It is the spirit that returns to God. The body goes to the earth, the spirit returns to God. Now check this out:
Ecclesiastes 3:19-21 KJV
For that which befalleth the sons of men befalleth beasts; even one thing befalleth them: as the one dieth, so dieth the other; yea, they have all one breath; so that a man hath no preeminence above a beast: for all is vanity. [20] All go unto one place; all are of the dust, and all turn to dust again. [21] Who knoweth
the spirit of man that goeth upward, and the spirit of the beast that goeth downward to the earth?
People and beasts both die, are both mortal, their bodies are both of the dust, and return to dust. But the SPIRIT of the beast returns to the earth, whereas the SPIRIT of the human returns to God. Why? Because the earth is what brought forth the beasts, whereas God brought forth humans.:
Genesis 1:24-27 KJV
And God said,
Let the earth bring forth the living creature after his kind, cattle, and creeping thing, and beast of the earth after his kind: and it was so. [25] And God made the beast of the earth after his kind, and cattle after their kind, and every thing that creepeth upon the earth after his kind: and God saw that it was good. [26] And God said,
Let us make man in our image, after our likeness: and let them have dominion over the fish of the sea, and over the fowl of the air, and over the cattle, and over all the earth, and over every creeping thing that creepeth upon the earth. [27] So God created man in his own image, in the image of God created he him; male and female created he them.
The animating factor or breath or spirit of life for the beasts came from the earth, whereas for humans it came directly from God. As here:
Genesis 2:7 KJV
And the Lord God formed man of the dust of the ground, and breathed into his nostrils the breath of life; and man became a living soul.
For EVERY HUMAN the SPIRIT goes back to God and the body goes back to dust. That is "death". The spirit is the breath of life, it was given by God and returns to God. At resurrection the spirit is reunited with the body, thus a resurrection occurs. The PERSON (or "living soul") is a combination of spirit and flesh, which produces a "soul". In death the two ingredients if you will are separated, and the person is no longer alive. Thus, no longer conscious or active either.
Until resurrection. After the resurrection, there is the Judgment, which is by definition the person's court appearance and trial and sentence and punishment or reward.
Nicodemus argued with the Court on this wise:
John 7:50-51 KJV
Nicodemus saith unto them, (he that came to Jesus by night, being one of them,) [51] Doth our law judge any man, before it hear him, and know what he doeth?
His argument is consistent with God's law and with reason: it is not right to condemn a man before examination and inquiry. That is, before his court trial. So the idea that people are sentenced by God BEFORE they are judged is unbiblical and contradictory. How can a man be judged before he is judged?
And I know this post will generate more questions lol. But there it is in a nutshell.