Consciousness is not a different thing, coming from somewhere.
You have a visible body and invisible consciousness. Similarly the universe also has visible physical world made of matter and energy, and invisible consciousness called Universal Consciousness.
Like water in ocean, consciousness exists everywhere spread in the entire universe. Physical body of universe including sun, moon, planets, stars, galaxies, mountains, rivers, trees, and all the living and nonliving things are created as a result of dynamism of the Universal consciousness, like tides, waves and bubbles getting created in ocean due to undercurrents.
The tides, waves, and bubbles in ocean are made of water, exist in water and merge back into water after completing cycle.
Similarly the universe created by consciousness, made of consciousness exists in consciousness and merges back into consciousness once the life cycle is completed.
Universal consciousness is the ultimate eternal truth existing in every atom of the universe and extending beyond, which is called Brahmam in Vedas.