"Where did God come from?" This is a popular objection from atheists. Unfortunately, it's also completely misguided, and only exposes the atheist for being utterly unfamiliar with classic monotheism.
Starting with Aristotle, which is where classic monotheism begins to really gel, the basic idea is that all changeable things (such as birds, people, planets, stars) cannot collectively be responsible for their own existence, because then they would be causing themselves to exist, and so would have to exist prior to them existing, which is a logical contradiction. To solve this, Aristotle hypothesizes that there must be something unchangeable which is responsible for the existence of changeable things. Because it is unchangeable, it cannot have a cause even in principle. A cause implies a change, so if something is unchangeable then it doesn't need nor can it even have a cause.
It must be emphasized that Aristotle is not speaking of the thing that triggered the Big Bang, but rather of a "substrate" that grounds the existence of changeable things, even if the universe is eternally old. Just like a room full of dancing people, even if infinitely old, still has to have a floor in order to hold the people up.
So now hopefully it is clear why Sagan's objection makes no sense, and is in fact complete gibberish. Asking where God came from is asking about a change in God, that he came from somewhere, or was caused by something. But the whole point of classic monotheism is that God is the unchangeable reality that grounds the existence of changeable things. So Sagan's objection translates as follows:
- What changed the thing that is not changeable?
You can see that this is a nonsense question. It entails a contradiction. It's like asking:
- Which mountain is higher than the highest mountain?