Joh 8:24 "Therefore I said to you that you will die in your sins; for if you do not believe that I am He, you will die in your sins."
The "He" is not in the original Greek. It simply reads: "if you do not believe that I am, you will die in your sins."
Though it is true that "I am" is an expression of diety, the context of John chapter 8 points to the claims of the Lord Jesus Christ as the Messiah.
Joh 8:25 Then they said to Him, "Who are You?" And Jesus said to them, "Just what I have been saying to you from the beginning.
What did He tell them from the beginning?
Joh 8:12 Then Jesus spoke to them again, saying, "I AM the light of the world...
In the Old Testament, the Messiah is said to be the light of the world or the nations.
The Messiah in the following is called "My Servant" God's Servant:
Isa 49:6 Indeed He says, 'It is too small a thing that You should be My Servant To raise up the tribes of Jacob, And to restore the preserved ones of Israel; I will also give You as a light to the Gentiles (Goyim in Hebrew or nations), That You should be My salvation to the ends of the earth.'"
When Simeon saw the baby Jesus, he said of Him:
Lu 2:32 A light to bring revelation to the Gentiles, And the glory of Your people Israel."
What does John 8:24 mean? If they do not trust in Him as the Messiah, the Christ, they will die in their sins. Read the book of Acts. The apostles Paul and Peter emphasized the Christhood of the Lord Jesus in their preaching and that trusting in Him sinners will be saved.