1257 The Lord himself affirms that Baptism is necessary for salvation.[59] He also commands his disciples to proclaim the Gospel to all nations and to baptize them.[60] Baptism is necessary for salvation for those to whom the Gospel has been proclaimed and who have had the possibility of asking for this sacrament.[61] The Church does not know of any means other than Baptism that assures entry into eternal beatitude; this is why she takes care not to neglect the mission she has received from the Lord to see that all who can be baptized are "reborn of water and the Spirit." God has bound salvation to the sacrament of Baptism, but he himself is not bound by his sacraments.
1258 The Church has always held the firm conviction that those who suffer death for the sake of the faith without having received Baptism are baptized by their death for and with Christ. This Baptism of blood, like the desire for Baptism, brings about the fruits of Baptism without being a sacrament.
1259 For catechumens who die before their Baptism, their explicit desire to receive it, together with repentance for their sins, and charity, assures them the salvation that they were not able to receive through the sacrament.
1260 "Since Christ died for all, and since all men are in fact called to one and the same destiny, which is divine, we must hold that the Holy Spirit offers to all the possibility of being made partakers, in a way known to God, of the Paschal mystery."[62] Every man who is ignorant of the Gospel of Christ and of his Church, but seeks the truth and does the will of God in accordance with his understanding of it, can be saved. It may be supposed that such persons would have desired Baptism explicitly if they had known its necessity.
1261 As regards children who have died without Baptism, the Church can only entrust them to the mercy of God, as she does in her funeral rites for them. Indeed, the great mercy of God who desires that all men should be saved, and Jesus' tenderness toward children which caused him to say: "Let the children come to me, do not hinder them,"[63] allow us to hope that there is a way of salvation for children who have died without Baptism. All the more urgent is the Church's call not to prevent little children coming to Christ through the gift of holy Baptism.
Finally, those who have not yet received the Gospel are related to the People of God in various ways (cf. St. Thomas Aquinas, Summa Theologica, Part 3, Q.8, Art. 3, Reply 1) ... Nor is God remote from those who in shadows and images seek the unknown God, since He gives to all men life and breath and all things (cf. Acts 17:25-28), and since the Savior wills all men to be saved (cf. 1 Timothy 2:4). Those who, through no fault of their own, do not know the Gospel of Christ or His Church, but who nevertheless seek God with a sincere heart, and, moved by grace, try in their actions to do his will as they know it through the dictates of their conscience - those too may achieve eternal salvation (cf. Letter of the Holy Office to the Archbishop of Boston). Nor shall divine Providence deny the assistance necessary for salvation to those who, without any fault of theirs, have not yet arrived at an explicit knowledge of God, and who, not without grace, strive to lead a good life. Whatever good or truth is found amongst them is considered by the Church to be a preparation for the Gospel (cf. Eusebius of Caesarea, Praeparatio Evengelica, 1.1) and given by Him Who enlightens all men that they may at length have life. But very often, deceived by the Evil One, men have become vain in their reasonings, have exchanged the truth of God for a lie and served the world rather than the Creator (cf. Romans 1.21, 25). Or else, living and dying in this world without God, they are exposed to despair. Hence to procure the glory of God and the salvation of all these, the Church, mindful of the Lord's command, "preach the Gospel to every creature" (Mark 16.16) takes zealous care to foster the missions. (Second Vatican Council, Lumen Gentium - Dogmatic Constitution on the Church, 16, November 21, 1964)
Those of Good Will must be brought to the Church by preaching to them. But God will also assure through His Providence that those of Good Will are brought to the Church, despite their explicit ignorance of the Gospel in their present state. God wishes the salvation of every man, so if He has prepared a man for the reception of the Gospel, that man WILL receive the Gospel.
Again, the Catechism of clear:
851. Missionary Motivation. It is from God's love for all men that the Church in every age receives both the obligation and the vigor of her missionary dynamism, "for the love of Christ urges us on," (2 Corinthinas 5:14; cf. Apostolicam actuositatem 6, Roman Missal 11). Indeed, God "desires all men to be saved and to come to the knowledge of the truth" (1 Timothy 2:4); that is, God wills the salvation of everyone through the knowledge of the truth. Salvation is found in the truth. Those who obey the prompting of the Spirit of truth are already on the way of salvation. But the Church, to whom this truth has been entrusted, must go out to meet their desire, so as to bring them the truth. Because she believes in God's universal plan of salvation, the Church must be missionary.
So you see, the virtuous man of good will is already on the path of salvation, because God has prepared him to receive grace. BUT, the Church must also go out and find these people. The annals of the Missions are filed with wonderful stories that make it very clear that this will always happen.