How is Jesus the only begotten son of God if he's co-equal and eternal with God?
Since God is eternal and his nature is constant and his nature is trinitarian, then Jesus is co-equal and eternal with God simply because that is God's nature--"Jesus" being the earthly name we, in English, assign to the 2nd person of the Trinity.
As to being "begotten", this has been a hot-issue over the millenia as it implies a conflict with being eternal. How, after all, could a being be begotten if it always existed?
This issue is generally credited with being a key theological point that caused the Great Schism giving us the RCC and the EO division of churches. The original creeds said that the Holy Spirit proceeded from the Father only. Some western theologians inserted (apparently without consultation) the filioque meaning "and the son"; that is, the Holy Spirit proceeds from both the Father "and the son".
So part of the answer is rooted in philosophical terms that are quibbles that make me wonder about the value of philosophy. In this case, the EO insist that the son, too, proceeds from the father. This would relate to be being begotten. Thus, the EO has a term that means something to them that maintains some concept of "begotten" though I confess it is beyond me. The RCC, OTOH, has lost that theological advantage. I don't know how they answer this question now. As the next paragraph might suggest, I'd guess that it has been addressed.
C.S. Lewis in
Mere Christianity does attempt to answer the question with a metaphor. Imagine a book sitting on a table. That book depends on the table for its position in space. Now imagine that book has been on that table for eternity. IIRC, Lewis acknowledges that there are weaknesses with this image. If something like the above existed, could you not say that the table depends on the book for its position. Or rather, in some eternal type situation, how could determine where the dependence actually is.
Some groups of Christians maintain that these things are best left a mystery. In my words, these concepts have value in the same way a zen koan does.