The good thief refers to the condemned man on the cross next to Jesus who acknowledged the innocence of Christ. Luke 23:39-43. He confessed the truth that he and his companion were "justly" (rightly judged) under the same sentence of condemnation, "but not this man". He believed that Jesus is the promised Messiah of Israel who would come to his kingdom and reign with kingly power. Luke 23:42. According to an ancient Christian tradition the man's name was Dismas; his companion's name was Gestas.
The good thief has been held up as an example of hope for every sinner who finally repents in extremis at the moment of death after having lived an entire lifetime of sin. He had committed murder and participated in an insurrection against authority (Mark 15:7; Romans 13:1-4), and it may be reasonably assumed that during his career he had been frequently intoxicated. Like the adulteress brought to Jesus (John 8:3-11), he had been caught in the very act. He was arrested, imprisoned, tried, convicted, condemned, sentenced to die, and taken out to be executed. He doubtless had drunk the stupefying anesthetic blend of wine and myrrh customarily offered as a mercy to criminals condemned to the excruciating agony of death by crucifixion. Mark 15:22-23. (St. Paul clearly teaches that "the unrighteous shall not inherit the kingdom of God", and he includes "drunkards" among them. 1 Corinthians 6:9-11. Paul himself was guilty of blasphemy. 1 Timothy 1:13-17. But the Bible also teaches that except for blasphemy against the Holy Spirit every other sin and blasphemy will be forgiven. Matthew 12:31.) While hanging on the cross, both he and his companion had blasphemed Jesus. Matthew 27:44. Then according to the account of the apostle Luke, who heard the eyewitness testimony of the apostle John, who stood with Mary the mother of Jesus by the cross and heard what was said, this thief afterward repented of the blasphemy he and his companion had both uttered against Him. Luke 1:1-2; John 19:25; Luke 23:39-41. He now had no opportunity to perform corporal and spiritual works of mercy "which God prepared beforehand that we should walk in them" (Ephesians 2:10; Philippians 2:12-13). His only good work was his repentance and believing in Jesus. Jesus forgave him. Luke 23:42-43. The example of the good thief and the testimony of other passages in the New Testament relating to long-delayed repentance at the point of death are given to sinners as the "sure and certain" reason for confident hope of salvation from hell. James 5:14-20; 1 John 5:14-17; Hebrews 6:19.