God created us to have relationship with Himself. In order to love Him, He gave us the ability to make our own choices. From the beginning of humanity, we’ve chosen to rebel. We’ve chosen sin. Sin is disobedience to God, and its consequence is eternal separation from God.
God is merciful and made a way to redeem us, to save us and deliver us from sin through the sacrifice of Jesus Christ. Acts 4:12 - And there is salvation in no one else, for there is no other name under heaven given among men by which we must be saved. Salvation means to be saved from God’s judgement on sin, to go from being spiritually dead to spiritually alive.
What do you have to do?
According to Paul and Silas (speaking to their jailer and his family) in Acts 16:31, it was very simple: "Believe in the Lord Jesus, and you will be saved." It’s not something that we can earn by being good enough. It’s only a gift that comes through trusting Jesus Christ. Ephesians 2:8 For by grace you have been saved through faith. And this is not your own doing; it is the gift of God.
When does it happen? Is it a process?
Though sin has real consequences in the world each and every day, God’s final judgement on sin is coming. In a since, our salvation from that is in the future. However, Scripture talks about salvation as though it is something that is given to us, or accounted to us, immediately. In Ephesians 2:8 mentioned above, Paul uses the phrase “have been saved”. It’s already happened. Jesus tells Nicodemus to be born again. Once you’re born, labor has finished! In 2 Corinthians 5:17, Paul calls those in Christ, "a new creation. The old has passed away. Behold, the new has come!”
That’s not to say that being saved will immediately make your life perfect, take away bad habits, or remove you from all the consequences of your choices in your life before Jesus. The process we’re given by God after being saved is called sanctification -being made holy. John 17 records Jesus prayer for His followers’ sanctification. That prayer was made on our behalf too, so it’s a great encouragement to read as acknowledge our need for Him, believe in His sacrifice, and step into the life He has for us on this Earth before eternity with Him in Heaven.