You are asking the most important question you can ever ask! Please read the following account from the Bible about a man who asked Jesus the same question. Then read the remarks below:
"A certain ruler asked him, 'Good teacher, what must I do to inherit eternal life?' 'Why do you call me good?' Jesus answered. 'No one is good--except God alone. You know the commandments: 'Do not commit adultery, do not murder, do not steal, do not give false testimony, honor your father and mother.' 'All these I have kept since I was a boy,' he said. When Jesus heard this, he said to him, 'You still lack one thing. Sell everything you have and give to the poor, and you will have treasure in heaven. Then come, follow me.' When he heard this, he became very sad, because he was a man of great wealth. Jesus looked at him and said, 'How hard it is for the rich to enter the kingdom of God! Indeed, it is easier for a camel to go through the eye of a needle than for a rich man to enter the kingdom of God.'" Luke 18:18-25 NIV
This indeed is a sad story. A wealthy young man comes to Jesus in search of salvation, but goes away without it. We can only hope that he later had a change of heart. However, in this brief interaction with Jesus we can learn how we can be saved. The young man called Jesus good. Jesus challenged this by saying "Only God is good." Jesus was not denying that He Himself was the Son of God, rather He wanted to give the young man a chance to make that profession.
Step #1: We must acknowledge that Jesus is God.
Next Jesus told the young man that he could be saved if he kept all of the commandments. This indeed is true. If anyone of us could manage to keep all of God's holy commandments perfectly, we could be saved on that basis alone. But we can't! That's why we need Jesus. Jesus was giving the young man an opportunity to humble himself and acknowledge that he needed Jesus.
Step #2: We must be willing to humble ourselves totally and admit that we are sinners.
Finally Jesus told the young man to sell everything he had, give the proceeds to the poor and follow Him. This the young man could not do, so he went away sad. It is not a requirement for salvation that everyone of us sell everything we have and give the money to the poor. However, we must put Jesus Christ first in our lives--above everything else that is near and dear to us. Unless Jesus is more important to us than everything else, He cannot be our Savior.
Step #3: We must make Jesus Christ Lord of our lives.
Faith is active, not passive. This is because it involves a personal relationship with Jesus!
"For God so loved the world that he gave his one and only Son, that whoever believes in Him shall not perish but have eternal life." (John 3:16 NIV)