Things don't just happen overnight. After recording Zechariah's song of praise to God for the gift of a son, Luke tells us that John had to grow up before he could begin his public ministry. John grew physically and spiritually during his years in the wilderness.
John may have spent some time with the Essene community. They were very concerned about preserving God's written word. The Dead Sea Scrolls containing books of the Old Testament were copied by the Essenes. They also practiced ritual washing or baptism as a sign of repentance.
Whether or not John spent time with the Essenes, he did learn the importance of repentance and the value of knowing God's Word during those years in the wilderness.
It takes time to grow and mature in our faith. A maturing faith requires that we repent, turn away from doing things our way and follow the Lord. It also requires that we read God's Word and take it to heart. The Holy Spirit will help us grow in faith and as followers of Jesus. Regardless of how young or old we are, we still need to grow in faith and grow closer to the Lord.