As detailed in Bhagavad Gita and Upanishads (independent spiritual treatises) Brahman exists from times immemorial. Brahman did not come from anywhere; it has always existed and shall continue to exist until eternity, forever.
Even before present cosmos came into being, Brahman still existed. How? Imagine a period in time when old cosmos is collapsing, dissolution of old cosmos in entirety has occurred. This results in everything contained in cosmos collapsing into a massive black hole, the singularity scientists’ world over often disputed, discussed about.
In absence of dross impurities within the size of entire collapsed cosmos reduces to size of half a thumb. And what is this half a thumb? The collective power of all souls’ atmans in their pure form occupied the volume of half a thumb. This magnanimous primordial cosmic energy size of half a thumb unable to contain itself for long in its prime pure state again explodes with a big bang, resulting in formation of a new cosmos, a new journey of life!
Even before origination of present cosmos Brahman existed and even after! As detailed in Bhagavad Gita all souls atmans were indestructible could neither be created nor destroyed. Brahman, collective power of all souls’ atmans in their pure form is the size of half a thumb. Brahman is the singularity in the beginning of cosmos explosion of which resulted in big bang.