You're right works don't keep us out, we are all destined for the fiery pits of hell.
. God gives us the option of accepting or declining his gift of eternal life.
When seeking what we can learn from the thief on the cross, it should be remembered that at the time of Jesus’ crucifixion, two thieves were crucified beside Him (Luke 23:33–43), and both began their time on the cross by mocking and blaspheming Him, as did many of the spectators. One of the thieves responded in faith to the message of salvation and was taken to paradise that very day. He is the one usually referred to as the thief on the cross, while the other man did not respond in faith and is now suffering from a deadly and eternal mistake.
It is remarkable that, while in the excruciating and mind-numbing torment of the cross, the Son of Man had the heart, mind, and will to pray for others. Yet it is a miracle that one thief, while in agony himself, heard the Spirit of God call him to repentance and acceptance of the forgiveness God was just about to provide through the death of Christ. While the disciples were abandoning the Lord, this man answered the call, and his sins were forgiven, including his blasphemy against the Son of God (Luke 5:31-32, 12:8–10).
That the other thief rejected Jesus is remarkable in its own right. While being tortured on the cross he literally joined his torturers in insulting the Savior of the world, and he most likely did so because he wanted his torturers to think he was just like them, joined to the world and with no love for God (Matthew 27:44). Not only was this man next to the Savior, he heard Him pray, he witnessed the salvation of the other thief, he saw the world go dark, and he heard the testimony of the Son. But his pride kept him from submitting to the only One who could save him, and when he one day bows to the Name he mocked, he will be doing so reluctantly and while in torment (Philippians 2:10).
What we learn from the saved thief on the cross is that we are all sinners in need of a Savior, and no matter the number of our sins and no matter if we, or the world, think our sins are minor or extreme, it is never too late to repent and accept the free gift of salvation (Ephesians 2:8–9; Revelation 22:17). Moreover, as long as someone still has a mind and the will to choose life over death (Hebrews 9:27), it is not too late to proclaim the gospel, which hopefully will open a heart to a miracle by the Holy Spirit.