Jewish people used to sacrifice animals to God to atone for their sins. The animal was used as a ransom for sin. The guilt of the nation was removed by this animal sacrifice, bringing divine forgiveness.
In the same way, Christ was sacrificed to "take away" the sin of the world, the sins of all those who believe in him. He was the lamb that was taken to the altar and slain. He was the lamb that the prophet Isaiah prophesied about. He was the sacrifice for sin, and through this sacrifice, believers are cleansed of their sins once and for all!
John the Baptizer knew that Jesus was not only the promised Messiah, but also the Lamb of God who would wash away all the sins of the world. Christ's sacrifice was so great that it enables all people to be cleansed. This was only possible because Christ was the only Son of God. Christ came as the saviour to bring salvation to mankind.