He baptized Jesus so that Jesus would be revealed to the world.
John 1:29-34
The next day he saw Jesus coming toward him, and said, Behold, the Lamb of God, who takes away the sin of the world! 30 This is he of whom I said, After me comes a man who ranks before me, because he was before me. I myself did not know him, but for this purpose I came baptizing with water, that he might be revealed to Israel. And John bore witness: I saw the Spirit descend from heaven like a dove, and it remained on him. I myself did not know him, but he who sent me to baptize with water said to me, He on whom you see the Spirit descend and remain, this is he who baptizes with the Holy Spirit. And I have seen and have borne witness that this is the Son of God.
Travel safely, dear one.
So John is fulfilling prophecy and doesn’t know his cousin, then why does the Bible mention that they are cousins?
Also, by what right did John call people to repentance and how could they repent prior to Christs death and resurrection?