From Pope St. John Paul II’s encyclical Veritatis Splendor (1993):
The words of Jesus just quoted also represent a call to form our conscience, to make it the object of a continuous conversion to what is true and to what is good. In the same vein, Saint Paul exhorts us not to be conformed to the mentality of this world, but to be transformed by the renewal of our mind (cf. Rom 12:2). It is the “heart” converted to the Lord and to the love of what is good which is really the source of true judgments of conscience. Indeed, in order to “prove what is the will of God, what is good and acceptable and perfect” (Rom 12:2), knowledge of God’s law in general is certainly necessary, but it is not sufficient: what is essential is a sort of “connaturality” between man and the true good.110 Such a connaturality is rooted in and develops through the virtuous attitudes of the individual himself: prudence and the other cardinal virtues, and even before these the theological virtues of faith, hope and charity. This is the meaning of Jesus’ saying: “He who does what is true comes to the light” (Jn 3:21).
Christians have a great help for the formation of conscience in the Church and her Magisterium. As the [Second Vatican] Council affirms: “In forming their consciences the Christian faithful must give careful attention to the sacred and certain teaching of the Church. For the Catholic Church is by the will of Christ the teacher of truth. Her charge is to announce and teach authentically that truth which is Christ, and at the same time with her authority to declare and confirm the principles of the moral order which derive from human nature itself”.111 It follows that the authority of the Church, when she pronounces on moral questions, in no way undermines the freedom of conscience of Christians. This is so not only because freedom of conscience is never freedom “from” the truth but always and only freedom “in” the truth, but also because the Magisterium does not bring to the Christian conscience truths which are extraneous to it; rather it brings to light the truths which it ought already to possess, developing them from the starting point of the primordial act of faith. The Church puts herself always and only at the service of conscience, helping it to avoid being tossed to and fro by every wind of doctrine proposed by human deceit (cf. Eph 4:14), and helping it not to swerve from the truth about the good of man, but rather, especially in more difficult questions, to attain the truth with certainty and to abide in it.
110 Cf. Saint Thomas Aquinas, Summa Theologiæ, II-11, q. 45, a. 2.
111 Declaration on Religious Freedom Dignitatis Humanæ, 14.
— Veritatis Splendor 64