The Buddha taught us to avoid evil and to do good. He also told us to abstain from wrong actions such as killing animals, drinking, gambling, adultery and oppressing others, as they will produce awful mental images which will disturb our mind and leave us without peace. As soon as we sit down to contemplate on the Buddha, the Dhamma and the Sangha, these images will be replaced by unpleasant forms and faces. These bad images will affect our mind and take away peace and tranquillity. For example, one who is frightened of ghosts is likely to be haunted by himself or herself always. When darkness falls, unwholesome scenes will appear in front of the person and consequently he or she will be convinced that they are either ghosts or other horrible things.
Eventually this type of person will always have fear and suspicion. He or she can be compared with someone who is so burdened with guilt from evil deeds that concentration of mind leading to mental strength cannot be gained. Fear cannot be overcome when that person has no Dhamma and thus no refuge.
If we have morality and concentration development, the Buddha, the Dhamma and the Sangha in mind, we will not have fear and horrible mental images. The Buddha will be reflected upon instead. Fear will be overcome and the frightening forms which are imagined to be ghosts will disappear. Only the Buddha image is perceived. There will be both good and bad signs visualised before passing away. The person who is meritorious will visualise good signs, the other person who has accumulated bad kamma in this life will visualise bad signs.