John 3:14:

And as Moses lifted up the serpent in the wilderness, even so must the Son of Man be lifted up:

Notes on John 3:14:

Here Jesus likened Himself to the metal serpent in Numbers 21:5-9.  When people looked at the serpent, a symbol of Christ, they were forgiven and healed.  It makes sense that you should get no less when you look to the Christ who was symbolized.

Christ on the cross was symbolized by a serpent (not a lamb) on a pole to emphasize that fact that He was “made sin” for us (2 Corinthians 5:21) on that cross before He died and He was “made a curse” for us (Galatians 3:13).

See also:

Notes on Numbers 21:5-9
Healing and Atonement
Forgiven People Can Be Healed
How Could Jesus Heal the Sick Based on His Future Atonement?
Objection: Jesus Was Not Really PUNISHED for Our Sins; He Just Shed Blood to Atone for Them