Initially an oral tradition passed on the message of the Gospel in the Church. Eventually more accounts of the life of Jesus were written down, often in the form of letters to the faithful from the apostles. These, along with the early Hebrew Scriptures, became the basis for the collection of writings we now know as Sacred Scripture: writings that were inspired by the Holy Spirit to faithfully contain the Good News of Salvation in Jesus Christ Our Lord.
Guarding the truths of the faith both in the oral tradition and written tradition of the Church has been given to the successors of the apostles. The Magisterium is "the living, teaching office of the Church whose task it is to give as authentic interpretation of the word of God, whether it is in written form (Sacred Scripture) or in Tradition." CCC Glossary
"The Roman Pontiff and Bishops are ‘authentic teachers, that is, teachers endowed with the authority of Christ, who preach the faith to the people entrusted to them, the faith to be believed and put into practice.’ CCC 2034
In a world of constant change and pluralism the Spirit filled teaching authority of the Church provides a secure rudder that believers can confidently follow to lead them on the sure path of Truth. The faithful have a right to be taught the truths of the faith, and "a duty to observe the constitutions and decrees conveyed by the legitimate authority of the Church". CCC 2037