John the Baptist said this when Jesus came to be baptised:
The next day he saw Jesus coming toward him and declared, “Here is the Lamb of God who takes away the sin of the world! This is he of whom I said, “After me comes a man who ranks ahead of me because he was before me.’ I myself did not know him; but I came baptizing with water for this reason, that he might be revealed to Israel.” (John 1:29-31)
This does not mean that Jesus existed before John (despite it being translated that way in some English Bible versions). Jesus was, in fact, conceived six months after John.
It means that Jesus ranks above John, not in time but by right of birth. The Greek word translated “before” can mean either “before in time” or “superior in rank”. Clearly, it is the second of these meanings which is intended here. The verse is saying that Jesus holds his superior rank, not by right of prior existence, but because he was born to it as Son of God.