Regarding the doctrine of salvation outside of the Church (extra ecclesiam nulla salus) perhaps the key word is extra. In Church teaching, this word for centuries was understood as outside, meaning if you were not fully incorporated into the Catholic Church by baptism, first holy Communion and confirmation and by giving your assent to all the teachings of the Church, then you could not be saved. Therefore, it was a common belief that Protestant Christians, as well as non-Christians (Jews, Muslims, et.al) would have no eternal life in heaven and would be condemned to hell. In time, this teaching was modified because many theologians of the Church pondered why souls would be damned for no fault of their own.
The Spanish Dominican theologians of Salamanca, during the discovery of the Americas, questioned why God would cast the Native Americans into the fires of hell merely because they had never heard of the salvific teachings of the Church. In addition, with the Protestant Reformation now two or three generations removed from the heretical Protestant reformers, how could Protestant Christians formed in the environment of the Reformation be fully culpable for their lack of understanding of Catholic teaching. These theological reflections were the subject of great debate in the Church and at the Second Vatican Council, they were addressed in the document on the Church, Lumen Gentium.
The council fathers reaffirmed the teaching that there is no salvation outside of the Church and in fact made it clear that if someone were to know that the Catholic Church is the true Church established by Jesus Christ and chose not to enter it or chose to leave it, they could not be saved (c.f. Lumen Gentium, 14). Yet, the council fathers also revisited the idea of extra, or “outside of the church.” In Latin this word can also mean except for, which can thus be interpreted as meaning “besides the Church” there is no salvation. Therefore, even a non-Catholic Christian or a non-Christian can be saved because the Church, especially in the Holy Sacrifice of the Mass, prays for the salvation of all people. Salvation therefore comes from Christ and through His Church (c.f. Ephesians 1:22-23) and goes forth to all the world, moving the souls of all people to conversion. Some people may never hear the Gospel, but because the Church prays for their salvation, they will at least follow the natural law to believe in God, avoid evil and love their neighbor. In this way, they can be saved.
Those who have heard the Gospel yet choose not to be formally incorporated into the Church, can be saved because Jesus understands the frailty of our human condition. Many are fearful of entering the Church because of great pressure from family or community and even in some regions of our world, because of the fear of persecution and even death. Others may be scandalized by the moral failings of Catholics and choose not to enter the Church, while still others may be incapable of fully understanding Catholic doctrine and teaching and thus are not culpable because of their ignorance. With this understanding, individuals may never fully embrace the Catholic faith, but can be saved because the Church, with great love and care for them, continually prays for their salvation.
Indeed, all people can be saved because the Church ceaselessly prays for the salvation of every soul before the Throne of Jesus, especially in the great prayer of the Holy Mass. Why do we have to go to Mass? As Catholics, with this question always placed before us, consider this one of the most compelling reasons: that all might be saved. In addition to praying for my own salvation at the Holy Mass, I am also concerned about the salvation of others, which makes my presence at Sunday worship a sacred duty and a deed of great love.