In John 3, the apostle records a conversation between Jesus and Nicodemus, a ruler of the Jews at that time. Nicodemus acknowledges that Jesus must be from God, as no one could perform the works He does unless He were sent by God. Jesus then reveals to Nicodemus that in order to enter the Kingdom of God, one must be born from above (John 3:3).
A brief side note is in order here. Many modern translations (KJV, ESV, ASB, etc.) render the Greek word ἄνωθεν (anōthen) in John 3:3 as "again." However, this word properly means "from above" and does not carry the connotation of something happening again, which would be conveyed by πάλιν (palin). This mistranslation has led to considerable confusion. Notably, these same translations correctly render ἄνωθεν (anōthen) as "from above" in John 3:31. Therefore, Jesus is not telling Nicodemus that he must be born again but rather that he must be born "from above." Of course, in order to be born from above after being born of the flesh, a rebirth must happen. However, Jesus' focus is on the origin of the birth, not in revealing how and when the new birth will happen.
Jesus speaks here concerning the Kingdom of God, not the Kingdom of the Heavens. The Kingdom of God pertains to salvation, whereas the Kingdom of the Heavens refers to the reign of Christ over the earth and is directly related to Israel. Jesus speaks about a new birth that is coming to those who believe. This confuses Nicodemus, who asks how it is possible for a man to be born again, as he assumes this would require a person to be physically born again from his mother's womb. However, Jesus is not speaking of a fleshly birth; instead, He reveals a regeneration that will happen in the spirit—a birth from above (John 3:6).
After the resurrection of Christ, this new birth is now possible because in raising Him from the dead, God created a new man (2 Corinthians 5:17). In Titus 3:5, Paul writes that we are not saved by our works but by God's mercy, through the washing and regeneration by the Holy Spirit. The Greek word for regeneration (παλιγγενεσία) is a birthing term (γεννάω), prefixed with the adverb "again" (πάλιν); hence, it means, "born again." Paul also speaks of this new birth in Galatians 4:29 while using Hagar and Sarah as examples of those born by the flesh in contrast to those by the Spirit.
When an individual believes that Christ died on behalf of our sins, was buried, and rose again on the third day according to the Scriptures, the Holy Spirit regenerates that person by placing God's seed within him (1 John 3:9). This regeneration happens in the spirit, where the human spirit is born again from above. Jesus foretold of this new birth when He stated that "God is Spirit, and those who worship Him it is necessary they worship in spirit and truth" (John 4:24). In order to prostrate oneself to God in spirit, that person's spirit must be connected to God. Those who are joined to the Lord through the washing and regeneration by the Holy Spirit are spiritually connected with God (1 Corinthians 6:17).
This new birth impacts the conduct of the person who is saved. One who is born of God cannot habitually sin (1 John 3:9). This verse does not indicate that those who possess the seed of God will never sin, as that would contradict what the apostle explicitly states in 1 John 1:6-9. Since this seed is imperishable (1 Peter 1:23), it cannot be corrupted. Therefore, by the nature of who a saved person is, when he functions from his spirit and follows the desires from the Holy Spirit, he cannot sin (1 Peter 4:1).