8For by grace you have been saved through faith; and that not of yourselves, it is the gift of God; 9not as a result of works, so that no one may boast (Eph 2:8-9 NASB)
AND this,
27Where then is boasting? It is excluded. By what kind of law? Of works? No, but by a law of faith. 28For we maintain that a man is justified by faith apart from works of the Law. 29Or is God the God of Jews only? Is He not the God of Gentiles also? Yes, of Gentiles also, 30since indeed God who will justify the circumcised by faith and the uncircumcised through faith is one (Romans 3:27-30 NASB)
is contradicting himself by saying we have to work to earn our salvation??
You might want to re-read those passages.