Christ's teaching comes to us through the Apostles and their successors.
At the Last Supper Jesus handed on to the Apostles what they would need to know for leading the Church, and he said that the Spirit would lead them to knowledge they were not ready for.
"I have much more to tell you , but you cannot bear it. But when he comes, the Spirit of truth, he will guide you to all truth."
Two centuries later, people began making up their own gospels. Then, the pope called on Irenaeus to straighten out those people. To keep them from making up their own Sacred Scriptures, Irenaeus quoted what Paul wrote to the Christians of Galatia:
"Even if an angel from heaven should preach to you a gospel other than the one we preached, let that one be accursed."