(This was before John was put in prison.)
Between the baptism and temptation of Jesus and the arrest of John the Baptist there was a period of time when both were ministering. Since the ministry of Jesus was in full swing, the disciples of John could start following Jesus when John was killed and his ministry came to an end. God had already provided for their spiritual needs.
This is all that is mentioned in the gospel of John about the Baptist’s imprisonment. The writer is interested in talking about Jesus, not John, whose purpose in this gospel is that he was a witness.
It is interesting to note that John did not retire, even though Jesus had started His own ministry (John 9:4). Retiring is not a concept to be found in the Bible. We will never come to the point where we have done enough for Christ that we can lay down our mantle and let someone else do all the work.
John 9:4 As long as it is day, we must do the work of him who sent me. Night is coming, when no-one can work.