He who was in the beginning did not begin when the beginning began.
John does not identify God as being “at the beginning” but rather “in the beginning.” In other words, He has always been, and “was” before the beginning. “Time” as a concept, began with creation. The “beginning” began with God already present to begin it. Thus He is eternal, existing before time.
Of course, the phrase which opens the book of John is the same used by Moses to open the book of Genesis. Whereas Moses opened with “In the beginning God…” John begins with “in the beginning was the Word…” John will then spend the next several verses describing this Word and showing that this Word is, in fact, God.
Note also that in the beginning “was” the Word. As with God, the Word was present before the beginning began. Thus the Word is eternal, existing before time. John differs greatly from the three Gospel records that precede this writing. Mark opens with the beginning of His ministry. Luke opens earlier than that, with the angel informing Mary that she was to be with child. And Matthew goes even further back in time, opening with a genealogical record of the Man, Jesus, in relation to Abraham (Luke of course offers his own genealogy of Jesus, tracing his lineage back to Adam himself).
John predates all of them, however, by starting with a Divine Being that was preexistent to the whole universe.
Or, as we said at the top: He who was in the beginning did not begin when the beginning began!