1 Peter 1:6-9: "6 In this you rejoice, though now for a little while, if necessary, you have been grieved by various trials, 7 so that the tested genuineness of your faith - more precious than gold that perishes though it is tested by fire - may be found to result in praise and glory and honor at the revelation of Jesus Christ. 8 Though you have not seen him, you love him. Though you do not now see him, you believe in him and rejoice with joy that is inexpressible and filled with glory, 9 obtaining the outcome of your faith, the salvation of your souls."
James 1:2-4: "2 Count it all joy, my brothers, when you meet trials of various kinds, 3 for you know that the testing of your faith produces steadfastness. 4 And let steadfastness have its full effect, that you may be perfect and complete, lacking in nothing."
1 Peter 4:12: "Beloved, do not be surprised at the fiery trial when it comes upon you to test you, as though something strange were happening to you."
Matthew 11:29-30: "29 'Take my yoke upon you, and learn from me, for I am gentle and lowly in heart, and you will find rest for your souls. 30 For my yoke is easy, and my burden is light.'"
+++
Only the first three stanzas are public domain:
1 Why should cross and trial grieve me?Christ is nearWith His cheer;Never will He leave me.Who can rob me of the heavenThat God's SonFor me wonWhen His life was given?2 When life's troubles rise to meet me,Though their weightMay be great,They will not defeat me.God, my loving Savior, sends them;He who knowsAll my woesKnows how best to end them.3 God gives me my days of gladness,And I willTrust Him stillWhen He sends me sadness.God is good; His love attends meDay by day,Come what may,Guides me and defends me.
+++
1 Peter 1:6-9, James 1:2-4, and 1 Peter 4:12 all mention trial(s) and appear most clearly in the hymn's first line ("Why should cross and trial grieve me?"), but the whole hymn develops the ideas in these passages.
Matthew 11:29-30 seems to appear (in an inverted way) at the beginning of the second verse: "When life's troubles rise to meet me, / Though their weight / May be great, / They will not defeat me." Instead of the light burden of rest, the hymn talks about the great weight of troubles.
+++
The lines "For I am / His dear lamb, / He, my Shepherd ever" in the fourth verse borrow imagery from John 10 ("'I am the good shepherd.'")
"Day and night" in the fifth verse is a merism.