The bible clearly answers this all important question for us. There are basically two steps to become a Christian. The first step is to understand and realize that you are a sinner and stand before a holy God without excuse. According to the bible, we each have inherited the sin nature from our ancestor Adam, the first man created by God. Therefore, no matter how good or how bad each of us is, we all are born with this sin nature. Once you realize that you are sinful by nature, not just by action, you are in a position to move on to step two: placing your trust in Jesus Christ.
Before Christ died on the cross, the only way a person could temporarily appease the wrath of God, due to their sinful nature, was by a yearly atonement of a blood sacrifice by the Jewish high priest. This animal sacrifice was required to be unblemished with no broken bones, a perfect specimen in every way. This requirement was a foreshadowing of the perfect and final sacrifice that God was planning to make by sending His own perfect Son to be sacrificed on the cross as a final atonement for the sin of all mankind. Upon offering the animal sacrifice for temporary atonement, the person was in essence looking forward in time to the day when the promised Messiah would come and take away the sin of the world, thus being saved by faith in that coming Messiah.
When a person realizes that he or she is inherently sinful and unable to be perfect of his or her own accord, and then understand that a perfect sacrifice has been made for them in the person of Jesus Christ, they can make the decision to lay aside their trust in themselves and their good deeds for attaining entrance into heaven. The alternative, and the only way to become a Christian, is to place total trust and dependence on the finished perfect work of Jesus Christ on the cross as the ultimate and final atonement for their sins.
When Christ willingly sacrificed himself on Calvary nearly 2000 years ago, the bible states that all sin (past, present, and future) was forgiven at that point. Therefore, there remains only one sin that stands in the way of one being accepted into Heaven, that of rejection of Jesus Christ and his supreme sacrifice. The bible also clearly states that it is by grace we are saved, through our faith in Jesus Christ's sacrifice, and it does not depend on what we have done, but that it is the gift of God, and is not a result of our goodness, so that no one can boast in and of themselves in achieving this success to become a Christian.
At the moment that a person decides to become a Christian by placing total faith in Jesus Christ for atonement of their sins, the bible says that God places that person spiritually in Jesus Christ's body, and declares them to be born a second time, spiritually, into God's family.