As long as a person stays in close fellowship with the Lord, he will not commit adultery, lie, murder, ect. We stay in fellowship with Him through prayer, Bible study, church, asking forgiveness as soon as we have sinned in any way. But, when we stop doing these things, we drift away from God and we can fall very, very far away from Him, but not as to lose our salvation. But He will discipline us because He chastises those He loves as sons. When we respond to His chastisement, we repent and fellowship is restored. And the Bible says this is a sure thing.
Hbr 12:11 All discipline for the moment seems not to be joyful, but sorrowful; yet to those who have been trained by it, afterwards it yields the peaceful fruit of righteousness.
If we do not respond, then the Lord may take our lives (sin unto death).
It is very important for the believer to maintain his fellowship with God to avoid chastisement, physical death, loss of rewards in heaven and a miserable life on earth, but he will not lose the eternal life that God has promised him.