"...God chose you for salvation through sanctification by the Spirit..."
2 Thessalonians 2:13

Sanctification in the Greek is HAGIASMOS and is separation to God, the course of life befitting those who are so separated.

The Holy Spirit is the Agent in sanctification:
Paul says in Romans 15:16 about his ministry, "That I might be a minister of Jesus Christ to the Gentiles, ministering the gospel of God, that the offering of the Gentiles might be acceptable, sanctified by the Holy Spirit."

Peter says in 1 Peter 1:1-2,
"Peter, an apostle of Jesus Christ, to God's elect, strangers in the world, scattered throughout Pontus, Galatia, Cappadocia, Asia and Bithynia, who have been chosen according to the foreknowledge of God the Father, through the sanctifying work of the Spirit."

Paul speaking of the unrighteous, he goes on to say in 1 Corinthians 6:11, "And such were some of you. But you were washed, but you were sanctified, but you were justified in the name of the Lord Jesus and by the Spirit of our God."

Sanctification as used for the separation to God:
"But of Him (God) you are in Christ Jesus, who became for us wisdom from God--and righteousness and sanctification and redemption--"
1 Corinthians 1:30

"But we ought always to thank God for you, brothers loved by the Lord, because from the beginning God chose you to be saved through the sanctifying work of the Spirit and through belief in the truth."
2 Thessalonians 2:13

Read 1 Peter 1:2 above as it speaks of this same thing.

Sanctification is that relationship with God entered into by faith in
Christ:
Paul in Acts 26:15-18 is relating to King Agrippa of the Lord apprehending him, "So I said, 'Who are You Lord?' And He said, 'I am Jesus, whom you are persecuting. Vs. 15 But rise and stand on your feet; for I have appeared to you for this purpose, to make you a minister and a witness both of the things which you have seen and of the things which I will yet reveal to you. Vs. 16 I will deliver you from the Jewish people as well as from the Gentiles, to whom I now send you, Vs. 17 To open their eyes and to turn them from darkness to light, and from the power of Satan to God, that they may receive forgiveness of sins and an inheritance among those who are sanctified by faith in Me.'" Vs. 18

As for the life befitting of those who are separated (sanctified):
"It is God's will that you should be sanctified: that you should avoid sexual immorality; that each of you should learn to control his own body in a way that is holy and honorable." 1 Thessalonians 4:3-4 And, Vs. 7'
"For God did not call us to be impure, but to live a holy life."

In Romans 6:19, Paul tells us,
"I speak in human terms because of the weakness of your flesh. For just as you presented your members as slaves of uncleanness, and of lawlessness leading to more lawlessness, so now present your members as slaves of righteousness for holiness."

It is learned from God as He teaches it by His Word:
Jesus prays to the Father in John 171;17

"Sanctify them by Your truth. Your word is truth."
"Concerning the works of men,
By the word of Your lips,
I have kept myself from the paths of the destroyer." Psalm 17:4

"How can a young man cleanse his way?
By taking heed according to Your word." Psalm 119:9

As set aside ones, let us seek after holiness that we may be holy as He is holy!
Thank you Lord for You unending love for us. Amen