There are three states people pass through after their death before arriving in heaven or hell. The first state involves their more outward aspects, the second involves their more inward aspects, and the third is a state of preparation. People pass through these states in the world of spirits.
As far as the first state is concerned, the state involving people's more outward aspects, they come into this state immediately after death.
All people have more outward and more inward aspects to their spirit. A spirit's more outward aspects are the means by which it adjusts the person's body in the world (especially his face, speech, and manner) for associating with other people. But the spirit's more inward aspects are the ones which belong to the person's intention and resultant thought, which are seldom evident in the face, speech, or manner. From infancy, people get used to displaying firendliness and kindness and sincerity, and hiding what their own intentions think. So as a matter of habit they wear a moral and civic life in outward matters, no matters, no matter what they are like inwardly.
This habit is the source of people's virtual ignorance of what lies deeper within them, and also of their inattention to these matters.
People's first state after death is like their state in the world, since at that point they are similarly involved in outward matters. They have much the same face, speech, and spirit, consequently they have much the same moral and civic life.
This is why they are then quite unaware that they are not still in the world, unless they pay attention to things that happen to them and to what they were told by angels when they were awakened - namely, that they are now spirits.
So the one life continues into the other, and death is only a crossing.
Whenever individuals in the other life think about someone else, they set the person's face before themselves in their thought, together with many other things that belong to the person's life. When they do, the other person becomes present as though called and summoned.
This kind of thing happens in the spiritual world because thoughts are communicated there and because distances do not have the same attributes as they have in the natural world. This is why everyone, on first arrival in the other life, is recognized by friends, relatives, and acquaintances of one sort or another, and this is also why they talk with each other and then associate with each other along the lines of their friendships in the world.
So they are taught by their friends about the state of eternal life, and are taken around to different places, into different companies. Some are taken to cities, to gardens and parks; most are taken to splendid places because this sort of place delights the outward nature they are involved in. Then they are intermittently led into thoughts they had during their physical life about the soul's state after death, heaven, and hell, until they resent their former utter ignorance of things like this, and resent the church's ignorance as well.
Almost all of them are eager to know whether they will get into heaven. Most of them believe that they will because they have led a moral and civic life in the world, without considering that evil and good people lead lives that are similar in outward aspects, do good works for other people in similar fashion, attend church in similar fashion, listen to sermons, and pray. They are wholly unaware that outward behavior and outward worship do not accomplish anything, but rather the inner elements from which the outward ones come.
Hardly one out of several thousand knows what inner elements are, or knows that they are where heaven and the church dwell within a person.
Then, too, all the spirits who arrive from the world are put into a connection either with a particular community in heaven or with a particular community in hell; but this applies only to their more inward elements. These more inward elements, however, are not visible to anyone as long as the spirits are involved in more outward matters, since outward matters cover and hide inner ones especially with people who are involved in something evil on a more inward level. Later on, when they come into the second state, these more inward elements become very obvious, because at that point their more inward reaches are opened, and their more outward ones recede.