tams tathavasitan viksya
yajnah sarva-gato harih
yamaih parivrto devair
tan—the demons and Raksasas; tatha—in that way; avasitan—who were determined to devour Svayambhuva Manu; viksya—upon observing; yajnah—Lord Visnu, known as Yajna; sarva-gatah—who is seated in everyone’s heart; harih—the Supreme Personality of Godhead; yamaih—with His sons named the Yamas; parivrtah—surrounded; devaih—by the demigods; hatva—after killing (the demons); asasat—ruled (taking the post of Indra); tri-vistapam—the heavenly planets.
The Supreme Lord, Visnu, who sits in everyone’s heart, appearing as Yajnapati, observed that the Raksasas and demons were going to devour Svayambhuva Manu. Thus the Lord, accompanied by His sons named the Yamas and by all the other demigods, killed the demons and Raksasas. He then took the post of Indra and began to rule the heavenly kingdom.
The various names of the demigods—Lord Brahma, Lord Siva, Lord Indra and so on—are not personal names; they are names of different posts. In this regard, we understand that Lord Visnu sometimes becomes Brahma or Indra when there is no suitable person to occupy these posts.
Link to this page: https://prabhupadabooks.com/sb/8/1/18