Everyone who dies in the state of grace will have eternal life in Heaven, perhaps after a temporary stay in Purgatory. The state of grace includes the three infused virtues: love, faith, hope. Whoever dies in this state is saved.
The state of grace is lost by any actual mortal sin, causing the loss of love and hope. The virtue of faith often remains, but it is not a faith enlivened by love and hope, so this type of faith does not save. Even so, by this dead faith, the person can know that he has sinned, and know that repentance leads to forgiveness and a return to the state of grace.
Certain sins, such as apostasy, cause the loss of the virtue of faith, as well as love and hope.
The state of grace can be lost by an actual mortal sin of omission. So sometimes “works” are required in order to attain salvation. If you refuse to do any and all good works, then you lose the state of grace.
Good works are also a testimony to our love of God and neighbor. So if you have faith, but no good works (indicating a lack of love), you might not be saved. But if you have faith and works (indicating love), then you are saved.
So it is not that works save, but that good works are a testimony to our love of God and neighbor, showing that our faith is enlivened by love and hope.
Please take a look at this list of my books and booklets, and see if any topic interests you.