Good works are our response to the work of Jesus Christ on the cross through whom we have redemption and eternal life. They show our love for God and for our neighbour. Clearly the New Testament exhorts us to good works.
But our salvation is through faith alone, through grace alone, through Christ alone. Because of this we know that we have salvation if we have truly believed the Gospel, by repenting of sin and believing on the Lord Jesus Christ, that He died for our sins and rose again from the dead. He wants us to walk in newness of life. If we get out of line, He may discipline us to bring us back into His way. But He will not cast us out, because we are saved by faith alone in what He has done for us, not in what we have done for Him. By faith not works. Works are the expression of our faith but not what give us salvation.