Srimad Bhagavatam Canto 07, Chapter 02, Text 36

SB 7.2.36

tatra ha preta-bandhunam
 asrutya paridevitam
aha tan balako bhutva
 yamah svayam upagatah
 
Translation by His Divine Grace A. C. Bhaktivedanta Swami Srila Prabhupada: 
 
While the queens were lamenting for the dead body of the King, their loud cries were heard even from the abode of Yamaraja. Assuming the body of a boy, Yamaraja personally approached the relatives of the dead body and advised them as follows.
 
Purport by His Divine Grace A. C. Bhaktivedanta Swami Srila Prabhupada: 
 
Sometimes the living entity is forced to give up his body and enter another one according to the judgment of Yamaraja. It is difficult, however, for the conditioned soul to enter another body unless the present dead body is annihilated through cremation or some other means. The living being has attachment for the present body and does not want to enter another, and thus in the interim he remains a ghost. If a living being who has already left his body has been pious, Yamaraja, just to give him relief, will give him another body. Since the living being in the body of the King had some attachment to his body, he was hovering as a ghost, and therefore Yamaraja, as a special consideration, approached the lamenting relatives to instruct them personally. Yamaraja approached them as a child because a child is not restricted but is granted admittance anywhere, even to the palace of a king. Besides this, the child was speaking philosophy. People are very much interested in hearing philosophy when it is spoken by a child.
Srimad Bhagavatam Canto 07, Chapter 02, Text 35
Srimad Bhagavatam Canto 07, Chapter 02, Text 37