Six months before Jesus was born, another baby boy was born. John was a cousin of Jesus. He was a miracle baby, born to Elizabeth, who was old and barren.
In my version of how things might have happened, I imagine that Jesus and John played together as children. Maybe they saw each other all the time, or maybe they only saw each other at the festivals and holidays, but I believe they were friends growing up.