Psalm 51:6-12: "6 Behold, you delight in truth in the inward being, and you teach me wisdom in the secret heart.
"7 Purge me with hyssop, and I shall be clean; wash me, and I shall be whiter than snow. 8 Let me hear joy and gladness; let the bones that you have broken rejoice. 9 Hide your face from my sins, and blot out all my iniquities. 10 Create in me a clean heart, O God, and renew a right spirit within me. 11 Cast me not away from your presence, and take not your Holy Spirit from me. 12 Restore to me the joy of your salvation, and uphold me with a willing spirit."
Hebrews 4:15-16: "15 For we do not have a high priest who is unable to sympathize with our weaknesses, but one who in every respect has been tempted as we are, yet without sin. 16 Let us then with confidence draw near to the throne of grace, that we may receive mercy and find grace to help in time of need."
Psalm 119:133: "Keep steady my steps according to your promise, and let no iniquity get dominion over me."
Luke 23:42-43: "42 And he said, 'Jesus, remember me when you come into your kingdom.' 43 And he said to him, 'Truly, I say to you, today you will be with me in Paradise.'"
+++
The text is public domain:
Lord Jesus, think on meAnd purge away my sin;From worldly passions set me freeAnd make me pure within.
Lord Jesus, think on me,By anxious thoughts oppressed;Let me Your loving servant beAnd taste Your promised rest.
Lord Jesus, think on meAmid the battle's strife;In all my pain and misery,O be my health and life!
Lord Jesus, think on meNor let me go astray;Through darkness and perplexityPoint out Your chosen way.
Lord Jesus, think on meThat, when this life is past,I may the eternal brightness seeAnd share Your joy at last.
+++
The text from Hebrews seems to be the basis for the hymn, specifically the repeated "Lord Jesus, think on me" at the beginning of each verse of the hymn.
The first verse comes from Psalm 51, specifically verses 7 and 10. The "promised rest" in the second verse seems to refer to Matthew 11:28: "'Come to me, all who labor and are heavy laden, and I will give you rest.'"
Psalm 119:133 appears in the fourth verse, and the fifth verse seems to come from Luke 23:42-43.