In order to have eternal life with God you must:
Recognize that you are separated from God because of sin. Romans 3:23
Recognize that what you get (wages) for what you do (sin) is death.
Accept that eternal life and heaven is a gift and can never be earned.
Trust that Jesus Christ has bridged the gap between you and God by giving His life as an offering for sin. Turning from your own efforts and sin to Jesus is the only way to satisfy God’s requirement for sin. You must receive Christ by faith to have the forgiveness of sin and experience eternal life.