The two most seemingly contradictory verses in the bible are Ephesians 2:8-9:
8 For by grace you have been saved through faith. And this is not your own doing; it is the gift of God, 9 not a result of works, so that no one may boast.which appears to be in stark contrast to James 2:24:
24 You see that a person is justified by works and not by faith alone.These verses oppose each other after a superficial reading. However when we dig into the context and the spirit of what Apostle Paul and James were communicating, we will show that they are just painting two sides of the same coin.
Paul's burden in Ephesians 2:8-9 was to teach believers not to boast about or trust in their accomplishments. We are all deserving of eternal separation of God in hell and if it wasn't for Jesus' work on calvary, we would all end up there. While mankind often judges people by human accomplishments, God is not a respecter of persons (Acts 10:34). You could be the greatest evangelist in world and save millions of souls but if you live a double life in sin and die without repenting, God will still throw your soul into hell (See Matthew 7:21-24 and Matthew 5, sermon on the mount).
On the flip side, James implicitly acknowledged that yes we're justified by faith in Christ Jesus alone, however that doesn't mean that we should just believe and do nothing. If we have no faith to back up our works then our faith is not real. Faith is living and active because it is the Spirit of grace that operates in us to produce good works. Works is evidence of faith, so without works, there is no faith and we are not truly born again. However, we should not do works thinking that they save us, rather it is a natural extension of our faith in Christ Jesus. The same apostle Paul who said we are saved by faith alone, goes on to state in the next verse in Ephesians 2:10 that we are a good workmanship in Christ Jesus and that we should walk in good works!
This is why Jesus teaches that when we give alms, we should do it without anyone knowing. When we carry out God's will we should do it out of genuine love for others, never expecting to get rewarded by men, but instead have faith that our Father will reward us. Works that are not genuine acts of faith are carried out with ulterior motives, such as winning someone's favor or doing something to look good.
What is true grace? First, it's us coming to the knowledge that there's not enough silver or gold we can pay for our sin because the penalty of sin is death (Romans 6:23). However, the blood of Jesus is enough to pay for our sin. After we receive it freely, we are no longer separated from God allowing Jesus to come into our life and live it for us. It's no longer we who live but Christ who lives in us (Galatians 2:20). So grace is God himself operating in us! That's why we shouldn't boast because God is doing it all for us.
However sin is an abomination to God's holiness (Proverbs 6:16). It's okay to stumble in sin once in a while and repent, but if we make sin a practice, we can lose God's presence and become separated from God again (Hebrews 10:26-27). If you're struggling with hidden sin, cry out to the blood of Jesus to free you. If that's still not enough, find someone you trust who you can confess to and become accountable to (James 5:16).
If you're reading this and thinking "but I can't lose my salvation!", please read the verses in this post: http://nodustybunnies.blogspot.com/2013/03/once-saved-always-saved-osas-true-or.html . The bible makes it very clear that eternal salvation is conditional and that you can lose it. This is why we need God's grace to save us! With man it is not possible, but with God all things are possible (Matthew 19:26), Hallelujah!