1 Peter 2:21-25: "21 For to this you have been called, because Christ also suffered for you, leaving you an example, so that you might follow in his steps. 22 He committed no sin, neither was deceit found in his mouth. 23 When he was reviled, he did not revile in return; when he suffered, he did not threaten, but continued entrusting himself to him who judges justly. 24 He himself bore our sins in his body on the tree, that we might die to sin and live to righteousness. By his wounds you have been healed. 25 For you were straying like sheep, but have now returned to the Shepherd and Overseer of your souls."
Matthew 16:24: "Then Jesus told his disciples, 'If anyone would come after me, let him deny himself and take up his cross and follow me.'"
John 8:12: "12 Again Jesus spoke to them, saying, 'I am the light of the world. Whoever follows me will not walk in darkness, but will have the light of life.'"
Matthew 10:38-39: "38 'And whoever does not take his cross and follow me is not worthy of me. 39 Whoever finds his life will lose it, and whoever loses his life for my sake will find it.'"
+++
The text is public domain:
"Come, follow Me," the Savior spake,"All in My way abiding;Deny yourselves, the world forsake,Obey My call and guiding.O bear the cross, whateve'er betide,Take My example for your guide."I am the light, I light the way,A godly life displaying;I bid you walk as in the day;I keep your feet from straying.I am the way, and well I showHow you must sojourn here below."My heart abounds in lowliness,My soul with love is glowing;And gracious words My lips express,With meekness overflowing.My heart, My mind, My strength, My all,To God I yield, on Him I call."I teach you how to shun and fleeWhat harms your soul's salvation,Your heart from ev'ry guile to free,From sin and its temptation.I am the refuge of the soulAnd lead you to your heav'nly goal."Then let us follow Christ, our Lord,And take the cross appointedAnd, firmly clinging to His Word,In suff'ring be undaunted.For those who bear the battle's strainThe crown of heav'nly life obtain.
+++
All of the cited passages deal with following Jesus, but the two from Matthew are a bit more prominent in the hymn text. "'Let him deny himself'" from Matthew 16:24 appears in the first verse ("Deny yourselves, the world forsake"), and "'take (up) his cross and follow me'" from both passages appears in the first verse ("Come, follow Me... O bear the cross") and in the fifth verse ("Then let us follow Christ, our Lord, / And take the cross appointed").
The text from 1 Peter 2 appears generally in the line "Take My example for your guide" at the end of the first verse. Part of verse 22 ("neither was deceit found in his mouth") may be the basis for "And gracious words My lips express, / With meekness overflowing" in the third verse, and part of verse 23 ("When he suffered, he did not threaten, but continued entrusting himself to him who judges justly") seems to appear in the fifth verse as "And, firmly clinging to His Word, / In suff'ring be undaunted."
"'I am the light of the world'" from John 8:12 appears at the beginning of the second verse. The line "I bid you walk as in the day" seems to combine "that you might follow in his steps" from 1 Peter 2:21 and part of Ephesians 5:8: "Walk as children of light." "I am the way" from later in the verse comes from John 14:6 ("Jesus said to him, 'I am the way, and the truth, and the life. No one comes to the Father except through me.'").
The last two lines of the hymn ("For those who bear the battle's strain / The crown of heav'nly life obtain.") seem to be drawn from part of Revelation 2:10: "'Be faithful unto death, and I will give you the crown of life.'"