Note that this isn't a contradiction of salvation by grace - genuine salvation always leads to a change in lifestyle, and good deeds, but the good deeds are the result and sign of salvation, not the cause of it.
Also, be careful that these verses don't cause you to doubt your own salvation without reason - let them instead lead you to walk closely with God, and to 'work out your salvation with fear and trembling'.