From the dogmatic constitution on the Church of the Second Vatican Council - The mission of the Holy Spirit in the church:
"When the Son completed the work with which the Father had entrusted him on earth, the Holy Spirit was sent on the day of Pentecost to sanctify the Church unceasingly, and thus enable believers to have access to the Father through Christ in the one Spirit. He is the Spirit of life, the fountain of water welling up to give eternal life. Through him the Father gives life to men, dead because of sin, until he raises up their mortal bodies in Christ. The Spirit dwells in the Church and in the hearts of the faithful as in a temple. He prays in them and bears witness in them to their adoption as sons. He leads the Church into all truth and gives it unity in communion and in service. He endows it with different hierarchical and charismatic gifts, directs it by their means, and enriches it with his fruits. By the power of the Gospel he enables the Church to grow young, perpetually renews it, and leads it to complete union with its Bridegroom. For the Spirit and the Bride say to the Lord Jesus: “Come!” In this way the Church reveals itself as a people whose unity has its source in the unity of Father, Son and Holy Spirit. The whole company of the faithful, who have an anointing by the Holy Spirit, cannot err in faith. They manifest this distinctive characteristic of theirs in the supernatural instinct of faith (‘sensus fidei’) of the whole people when, from the bishops to the most ordinary lay person among the faithful, they display a universal agreement on matters of faith and morals. This instinct of faith is awakened and kept in being by the Spirit of truth. Through it the people of God hold indefectibly to the faith once delivered to the saints, penetrate it more deeply by means of right judgement, and apply it more perfectly in their lives. They do all this under the guidance of the sacred teaching office: by faithful obedience to it they receive, not the word of men but in truth the word of God."
People sometimes use sensus fidei to justify heterodox doctrines that contradict orthodox teaching, missing the entirety of the point as emphasized above, that it applies when all are in agreement from the bishops down to the lay people. The whole people spans the centuries all the way back to the Apostles, and to the bishops that taught and clarified after them. Another crucial point is that the Spirit who reveals all this is the same Spirit of communion and unity, thereby making contradictions impossible. Blessed John Henry Newman made the case for the organic growth of doctrine that explains how doctrines can be applied to new settings without any rupture in Truth. A new doctrine is therefore suspicious when it contradicts orthodox teaching and the magisterium.