It is acknowledged that man’s interior must be purified before the good that he does is good; for the Lord says, “Thou blind Pharisee, cleanse first the inside of the cup and of the platter, that the outside may be clean also” (Matthew 23:26).
Man’s interior is purified only as he refrains from evils, in accordance with the commandments of the Decalogue. So long as man does not refrain from these evils and does not shun and turn away from them as sins, they constitute his interior, and are like an interposed veil or covering, and in heaven this appears like an eclipse by which the sun is obscured and light is intercepted; also like a fountain of pitch or of black water, from which nothing emanates but what is impure. That which emanates therefrom and that appears before the world as good is not good, because it is defiled by evils from within, for it is Pharisaic and hypocritical good. This good is good from man and is meritorious good. It is otherwise when evils have been removed by a life according to the commandments of the Decalogue.
Now since evils must be removed before goods can become good the Ten Commandments were the first of the Word, being promulgated from Mount Sinai before the Word was written by Moses and the prophets. And these do not set forth goods that must be done, but evils that must be shunned. For the same reason these commandments are the first things to be taught in the churches; for they are taught to boys and girls in order that man may begin his Christian life with them, and by no means forget them as he grows up; although he does so. The same is meant by these words in Isaiah:
“What is the multitude of sacrifices” to Me? Your meat offering, your incense, “your new moons, and your appointed feasts, My soul hateth. . . And when you multiply prayer I will not hear. . . Wash you, make you clean; put away the evil of your doings from before Mine eyes; cease to do evil . . . . Then though your sins were as scarlet they shall be white as snow; though they were red as purple they shall be as wool” (Isaiah 1:11-19.
“Sacrifices,” “meat offerings,” “incense,” “new moons,” and “feasts,” also “prayer,” mean all things of worship. That these are wholly evil and even abominable unless the interior is purified from evils is meant by “Wash you, make you clean, put away the evil of your doings, and cease to do evil.” That afterward they are all goods is meant by words that follow.
When man’s interior is purified from evils by his refraining from them and shunning them because they are sins, the internal which is above it, and which is called the spiritual internal, is opened. This communicates with heaven; consequently man is then admitted into heaven and is conjoined to the Lord.
There are two internals in man, one beneath and the other above. While man lives in the world he is in the internal which is beneath and from which he thinks, for it is natural. This may be called for the sake of distinction the interior. But the internal that is above is that into which man comes after death when he enters heaven. All angels of heaven are in this internal, for it is spiritual. This internal is opened to the man who shuns evils as sins; but it is kept closed to the man who does not shun evils as sins.
This internal is kept closed to the man who does not shun evils as sins, because the interior, that is, the natural internal, until man has been purified from sins, is hell; and so long as there is hell there heaven cannot be opened; but as soon as hell has been set aside it is opened. But let it be noted that in the measure in which the spiritual internal and heaven are opened to man, the natural internal is purified from the hell that is there. This is not done at once, but successively by degrees. All this makes clear that man from himself is hell, and that man is made a heaven by the Lord, consequently that he is snatched out of hell by the Lord, and raised up into heaven to the Lord, not without means but through means; and these means are the commandments just mentioned, by which the Lord leads him who wishes to be led.
from Spiritual Life and the Word of God, Part First