In 1 Corinthians 5:3-5 Paul gave instructions about how to deal with a member of the church who was living a sinful lifestyle and showed no inclination to repent of it.
For though absent in body, I am present in spirit; and as if present, I have already pronounced judgment on the one who did such a thing. When you are assembled in the name of the Lord Jesus and my spirit is present, with the power of our Lord Jesus, you are to deliver this man to Satan for the destruction of the flesh, so that his spirit may be saved in the day of the Lord.
He was to be expelled from the church and from fellowship with other Christians but the purpose of this action was to make him see the seriousness of his sin so that he would repent of it. Apparently it was effective because in 2 Corinthians 2:5-11 he told the church to restore to fellowship a sinner who had been expelled and later repented.
Now if anyone has caused pain, he has caused it not to me, but in some measure—not to put it too severely—to all of you. For such a one, this punishment by the majority is enough, so you should rather turn to forgive and comfort him, or he may be overwhelmed by excessive sorrow. So I beg you to reaffirm your love for him.
For this is why I wrote, that I might test you and know whether you are obedient in everything. Anyone whom you forgive, I also forgive. Indeed, what I have forgiven, if I have forgiven anything, has been for your sake in the presence of Christ, so that we would not be outwitted by Satan; for we are not ignorant of his designs.
It isn’t certain whether both of these are referring to the same person, but whether or not that is the case the message is clear. A professed Christian who lives in sin is to be expelled from the church but is to be restored to membership if he repents of his sin.
In his letters to Timothy Paul tells of two other people who were disciplined in this way. In 1 Timothy 1:19,20 Paul says,
Some have made shipwreck of their faith, among whom are Hymanaeus and Alexander, whom I have handed over to Satan that they may learn not to blaspheme.
What was the result of this action? In 2 Timothy, when warning against false teachers, Paul says,
Among them are Hymenaeus and Philetus, who have swerved from the truth, saying that the resurrection has already happened. They are upsetting the faith of some.
2 Timothy 2:17-18
Hymanaeus is still continuing in his sinful ways but Alexander is no longer his partner, so evidently he must have repented.
Why did the two respond differently? One possible explanation is that Hymanaeus wasn’t really a believer but only professed to be one while Alexander was really a Christian. Being barred from the fellowship of other Christians was a real punishment for Alexander and it led him to repent, while Hymanaeus wasn’t bothered by the lack of fellowship and simply found a new partner to help him spread his false teaching. Church discipline not only brings sinning Christians back to God but also exposes those in the church who aren’t really Christians at all.
2 Timothy 4:14 mentions someone named Alexander the coppersmith who had harmed Paul.
Alexander the coppersmith did me great harm; the Lord will repay him according to his deeds.
It is unlikely that this was the same Alexander mentioned in 1 Timothy. The fact that Paul calls him “the coppersmith” shows that Paul and Timothy knew more than one Alexander and the mention of his occupation showed which one he was talking about. Paul said that this man had harmed him but said nothing about him departing from the faith. Instead of delivering him to Satan Paul left his punishment to God. Apparently he was someone who had never professed to be a believer so Paul didn’t respond to him the same way he did to the other Alexander.