Certainly the Bible commands us to live good lives; if we don't, it may indicate we don't belong to Christ after all. Jesus said, "Let your light so shine before others, that they may see your good deeds and glorify your Father in heaven" (Matthew 5:16).
But we don't do good works in order to impress God so He'll reward us with salvation! You see, no matter how good we are, we can never be good enough to win our way into heaven, because God's standard is nothing less than perfection. In other words, if we broke just one of God's laws, we still wouldn't be pure enough to win God's favor. And yet we've all broken His laws, frequently and repeatedly. As the Bible says, "For all have sinned and fall short of the glory of God" (Romans 3:23).
Does this mean we have no hope? No, not at all -- because God has done for us what we could never do for ourselves. What did He do? He sent His only Son, Jesus Christ, into the world to pay the price for our salvation. He was perfect and without sin, but on the cross, all our sins were transferred to Him, and He took upon Himself the judgment that you and I deserve.
Now God offers us salvation as a free gift -- free, because Jesus Christ has already paid for it by dying in our place. By a simple prayer of faith receive that gift today by asking Christ to come into your life. You'll never regret it.