kadacid dhyayatah srastur
veda asams catur-mukhat
katham sraksyamy aham lokan
samavetan yatha pura
kadacit—once upon a time; dhyayatah—while contemplating; srastuh—of Brahma; vedah—the Vedic literature; asan—became manifested; catuh-mukhat—from the four mouths; katham sraksyami—how shall I create; aham—myself; lokan—all these worlds; samavetan—assembled; yatha—as they were; pura—in the past.
Once upon a time, when Brahma was thinking of how to create the worlds as in the past millennium, the four Vedas, which contain all varieties of knowledge, became manifested from his four mouths.
As a fire can consume anything and everything without being contaminated, so, by the grace of the Lord, the fire of Brahma’s greatness consumed his desire for the sinful act of sex with his daughter. The Vedas are the source of all knowledge, and they were first revealed to Brahma by the mercy of the Supreme Personality of Godhead while Brahma was thinking of re-creating the material world. Brahma is powerful by dint of his devotional service unto the Lord, and the Lord is always ready to forgive His devotee if by chance he falls down from the noble path of devotional service. The Srimad-Bhagavatam (11.5.42) confirms this as follows:
“Any person who is engaged one hundred percent in the transcendental loving service of the Lord, at His lotus feet, is very dear to the Personality of Godhead Hari, and the Lord, being situated in the heart of the devotee, excuses all kinds of sins committed by chance.” It was never expected that a great personality like Brahma would ever think of sex indulgence with his daughter. The example shown by Brahma only suggests that the power of material nature is so strong that it can act upon everyone, even Brahma. Brahma was saved by the mercy of the Lord with a little punishment, but by the grace of the Lord he did not lose his prestige as the great Brahma.
Link to this page: https://prabhupadabooks.com/sb/3/12/34