Remember, a handful of seemingly condemning works-based scriptures cannot negate the over 200 verses explaining that salvation is through faith in Christ alone. There must be another way to interpret them.
John 3:16 — For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life.
Ephesians 2:8-9 — For by grace you have been saved through faith, and that not of yourselves; it is the gift of God, not of works, lest anyone should boast.