The problem is the Bible translation. “In the beginning the Word was with God” means Jesus who is the Word was with God. It does not mean “Jesus was with Jesus”, or “God was with God.” No one can be with himself.
And, at end of John 1:1 in older versions of the Bible reads “the Word was a “was divine,” AT; Mo; or “of divine being,” Böhmer; Stage (both German)], “a god; a godlike one; divine; a divine being.”
See what a Bible Dictionary says in reference to John 1:1:
“Jn 1:1 should rigorously be translated ‘the word was with the God [= the Father], and THE WORD WAS A DIVINE BEING.’”-- (Dictionary of the Bible by John J. MCKenzie, New York, 1965), p. 317.
Another important thing to notice about John 1:1 is that it only speaks of two persons, not three as the Trinity Doctrine says.
Jesus is the Christ, the Messiah, and God's Son, not God, (Mathew 14:33). God’s name is Jehovah, Psalm 83:18.