Yama, the lord of justice and time, is portrayed as the mover of samsara and guardian of spiritual practice whom plays a roll that is seeing to pass judgement on those who are dead to send them to the appropriate rebirth on earth in heaven or hell. The dead will meet the judge and be asked in front of a mirror of their naked soul where their motives originated and to as whether they saw the messenger of light. Yama is a symbol of one's own karmic accumulation and is a solidified self-reflection which will make one's karmic consequences manifest appropriately (or inappropriately) in a realm with evil doing being noting compared to the punishment in worlds after the death. The judge is really ones consciences impartiality to that of love and righteousness and the mirror is the memory. The moral to be found is to not be so hard on yourself!
Yama was born as a holy man whom was told if he meditated for 50 years, he would achieve enlightenment. On the final day of his meditation he was interrupted by two thieves whom had a stolen bull. After beheading the bull in front of the hermit,they ignored his pleas to be spared for but a few minutes and beheaded him as well. In his near-enlightened fury the holy man became Yama, the god of Death. Taking the bull's head for his own he killed the two thieves and than decided to kill everyone in Tibet. The people of Tibet, fearing for their lives, prayed to the bodhisattva Manjusri who took up their cause. He transformed himself into Yamāntaka, similar to Yama but far more powerful and horrific. In their battle, everywhere Yama turned, he found infinite versions of himself. Yamāntaka defeated Yama and turned him into a protector of Buddhism.
Yamantaka (Daitoku in Japanese Buddhism) is the terminator of death. Terminating death, that is ending the cycle of rebirth and samsara, can be considered the goal of the journey to enlightenment. We all can experience three kinds of death, that is the end of our physical life, the end of our inner ignorance to the true nature of non-dual reality along with our instinctual habitual grasping and aversions to the objective "real" objects stemmed of ignorance and finally the secret death of the subtlest level of clear light and illusory body. The mind of pure light is able to perceive that death has no intrinsic concrete existence and that our understanding of death is all relative to the the world. Realizing Yamantaka is realizing buddhahood and thus one gains immortality through transcending death.
All of the realms of life are depicted between the jaws, or in the arms of a monstrous Yama. Yama is sometimes shown with a consort that is the physical manifestation of his shakti or inner feminine energy. Shakti derives of the goddess Shakta whom set forth the wheel of manifested life by bestowing her healing spirit into the womb of every species on the earth. Shakti is in all things as a man is both mother and father, he to contains an inner femenine energy. Thus the manifestation resembles the law of correspondence "as within, so without." Your outer world is like a mirror that reflects back to you what is going on in your inner world. Everything that happens outside of you corresponds to something that's going on inside of you. When we say that your outer world is a reflection of your inner world, we mean both at a conscious and at a subconscious level.
The fear of death follows from the fear of life. A man who lives fully is prepared to die at any time. ~Mark Twain