The following is from MyBible.com:
In the beginning was the Word, and the Word was with God, and the Word was God. - John 1:1 NKJV
John opens up with an echo of Genesis 1:1 "In the beginning God created". However this is not simply meant to reverberate Genesis 1, but also clarifies who creator God is. Herein lies the foundation of the doctrine for the Trinity, "The Word was with God" shows us that God has an interpersonal relationship "with God".
We know that "the Word" is none other than Christ who walked among us, so the text "the Word was God" expels all other teachings that Christ was just a man, teacher, prophet or angel. Jesus is in fact God and existed from eternity past as part of the Trinity. Through Him all things were made and without Him was not anything made that was made. Praise His name!