Some Christian denominations think that the spirit is not immortal and that death is like sleeping.

When Christ comes back he would resurrect the dead bodies from within the ground (like God made Adam from the earth).

Revelation 20:5-6 The rest of the dead did not come to life until the
thousand years were ended. This is the first resurrection. 6 Blessed
and holy is the one who shares in the first resurrection! Over such
the second death has no power, but they will be priests of God and of
Christ, and they will reign with him for a thousand years.

My questions are -

If the spirit is immortal what is the meaning of second death? The first death is death of body. Can the spirit also die?

If we go to heaven when we die how does the resurrection work? Would our spirits be taken from heaven and reinserted into a body?

But someone will say, “How are the dead raised? And with what kind of body do they come?”... All flesh is not the same flesh, but there is one flesh of men, and another flesh of beasts... There are also heavenly bodies and earthly bodies... So also is the resurrection of the dead... it is sown a natural body, it is raised a spiritual body... Just as we have borne the image of the earthy, we will also bear the image of the heavenly -1 Corinthians 15:35-49

Q&A

Why would a person believe that the spirit lives on when the body is dead? Answer: There are many passages (such as this one) that indicate that prior to the "first resurrection" and "second death", the spirits of those who have died are still "alive".

Aren't the spirits of sinners already separated from God? Answer: No; not in the ultimate sense. There is a lot more grace in the lives of sinners right now than people realize. The separation that comes at the final judgment is too terrible to describe in words. Clearly sinners are not experiencing the torment of that ultimate separation here on earth.