tl;dr: Heaven and hell are a decision of the mind based on what it believes to be true.
The ego thrives by hiding an ugly truth from us: we need suffering and pain in order to sustain our belief in the separation from God – our Oneness in Heaven.
Our painful existence ‘proves’ that Heaven is an illusion, that God, if He exists, must be a very cruel person indeed, and that the ego is all we have to get something out of life.
Therefore, the ego’s thought system induces the mind to project a physical body and a material world throwing in all forms of suffering and pain to make a very convincing package deal of separation.
Sin, guilt, death and fear are illusory concepts made by the ego’s thought system of separation and completely alien to the Oneness that is God, Who is nothing but Love and our only Reality.
Sin is the decision to oppose our Oneness in God.
Guilt is the experience of being sinful.
Death is the punishment for a life of sin.
Fear is caused by the ideas of punishment and death.
This is the ego illusion in a nutshell.
The mind decides what it believes to be true, but when it decides to take the ego’s thought of separation for real, it gives up its own all-encompassing knowledge and sides completely with the illusion of ego, taking the ego as its God and making life hell.
The thought of ego is very well aware that a change of mind (suppose we realize our innate Happiness) would make it totally disappear. Therefore, the ego secures its own survival by convincing the mind that it is now reduced to the brain function of a physical body, which makes it impossible for the mind to change its original decision made on the immaterial level of spirit.
This way, the body is what always dies and the ego lives on in the oblivious mind (that has forgotten all about its own spiritual level of existence) through incarnation after incarnation, forever propagating the ego’s hellish thought system in separate lives.
In truth, all of this is only a dream, of course. It never really happened because in reality it is absolutely impossible. Yet, a life of separation with innumerable problems always ending in death, is what we all seem to experience, and both science and religion fully support its ‘reality.’
However, no matter what kind of disaster seems to be happening, the nature of my dream experience changes depending on what I want to believe at each moment, because the source of every problem – and its solution – can only be found in the mind – and it is always the same.
Every loving thought that the Son of God [All of us because we are created One] ever had is eternal. The loving thoughts his mind perceives in this world are the world’s only reality. They are still perceptions, because he still believes that he is separate. Yet they are eternal because they are loving. And being loving they are like the Father, and therefore cannot die. The real world can actually be perceived. All that is necessary is a willingness to perceive nothing else.
— A Course in Miracles, T-11.VII.2.