Works has nothing to do with either initial or ultimate salvation.
Salvation is completely by grace through faith (
Ephesians 2:8-9).
Where do works come in?
If I am truly saved then I have received the gift of salvation through what Christ did for me on the Cross. This was such an amazing act of love that if I become the recipient of its work in my life, I also become eternally grateful to the Lord who gave up His life for me. I begin to love Him because He first loved me (
1 John 4:19). (This is the psychological aspect).
Also, when Jesus died on the Cross He said to the Father, "Into thy hands I commend my Spirit." The Father received Jesus' Spirit and then 50 days after Jesus rose from the dead, on the day of Pentecost, he poured it out on the early church. Now the love of God is shed abroad in the heart of every true born again believer since the first day God poured out His Spirit (
Romans 5:5). This love is not in word or in tongue only, but in deed and in truth (
1 John 3:17-18); and it is the fulfilling of the law within us (
Romans 13:8-10,
Romans 8:4), being the result of the indwelling of the Holy Ghost in the heart of the born again believer. (This is the spiritual aspect).
These works of love are the outflow of real salvation; but they don't save us in the slightest, neither initially nor ultimately.
They are simply the evidence that we have really been saved.
If I plant a plant in the ground; it can never bear fruit unless the roots are firmly planted into the ground: but I can have the roots entrenched into the ground without the resulting fruit. The health of the plant is not dependent on the fruit that it bears, but it is dependent on whether its roots are firmly planted. The fruit is the evidence that the plant is firmly planted; it is the sign to us all that the plant is receiving nourishment from the ground. The health of the plant is dependent on the root not the fruit.
Now the root has to do with the message of the gospel, that Christ died for our sins according to the scriptures, that he was buried, and that he rose again the third day according to the scriptures. The root has to do with our faith in these facts; and how we are forgiven of every sin through these facts and our faith in them.
The fruit of the Spirit is primarily love; which manifests itself in the good works that we do, provided we are not doing them for the wrong reason, such as an attempt to earn "ultimate salvation" or some other such thing as that.
The works that we do must be based solely and completely on our love for Christ which comes as our thankfulness overflows over what He did for us so freely.