Faith, Works, and Salvation

Am I saved by faith or good works? As a new Christian, I was relieved to hear that salvation doesn't depend on works, but solely on God's gift of grace. But then someone told me that "faith without works is dead" and that God cares as much about my actions as He does about my beliefs. Now I'm worried. Maybe I'm not "doing" enough to get into heaven. What do you think? Can you help me understand what seems like a contradiction?