Pure religion and undefiled before the Father is this: “To visit the fatherless and widows in their affliction, and to keep himself unspotted from the world.” Good deeds are the fruit that Christ requires us to bear: kind words, deeds of benevolence, of tender regard for the poor, the needy, the afflicted. When hearts sympathize with hearts burdened with discouragement and grief, when the hand dispenses to the needy, when the naked are clothed, the stranger made welcome to a seat in your parlor and a place in your heart, angels are coming very near, and an answering strain is responded to in heaven. Every act of justice, mercy, and benevolence makes melody in heaven. The Father from His throne beholds those who do these acts of mercy, and numbers them with His most precious treasures. “And they shall be Mine, saith the Lord of hosts, in that day when I make up My jewels.” Every merciful act to the needy, the suffering, is regarded as though done to Jesus. When you succor the poor, symp…
"Then shall the King say unto them on his right hand, Come, ye blessed of my Father, inherit the kingdom prepared for you from the foundation of the world: For I was an hungred, and ye gave me meat: I was thirsty, and ye gave me drink: I was a stranger, and ye took me in: Naked, and ye clothed me: I was sick, and ye visited me: I was in prison, and ye came unto me. Then shall the righteous answer him, saying, Lord, when saw we thee an hungred, and fed thee? or thirsty, and gave thee drink? When saw we thee a stranger, and took thee in? or naked, and clothed thee? Or when saw we thee sick, or in prison, and came unto thee? And the King shall answer and say unto them, Verily I say unto you, Inasmuch as ye have done it unto one of the least of these my brethren, ye have done it unto me."
Both passages emphasize the importance of acts of kindness and compassion towards the needy, with the EGW passage elaborating on the blessings and rewards associated with such actions, echoing the sentiments in Matthew 25:34-40.
"“Then shall He say also unto them on the left hand, Depart from Me, ye cursed, into everlasting fire, prepared for the devil and his angels: for I was an hungered, and ye gave Me no meat: I was thirsty, and ye gave Me no drink: I was a stranger, and ye took Me not in: naked, and ye clothed Me not: sick, and in prison, and ye visited Me not. Then shall they also answer Him, saying, Lord, when saw we Thee an hungered, or athirst, or a stranger, or naked, or sick, or in prison, and did not minister unto Thee? Then shall He answer them, saying, Verily I say unto you, Inasmuch as ye did it not to one of the least of these, ye did it not to Me. And these shall go away into everlasting punishment: but the righteous into life eternal.” Matthew 25:41-46 . 2T 25.2"
"Then shall he say also unto them on the left hand, Depart from me, ye cursed, into everlasting fire, prepared for the devil and his angels: For I was an hungred, and ye gave me no meat: I was thirsty, and ye gave me no drink: I was a stranger, and ye took me not in: naked, and ye clothed me not: sick, and in prison, and ye visited me not. Then shall they also answer him, saying, Lord, when saw we thee an hungred, or athirst, or a stranger, or naked, or sick, or in prison, and did not minister unto thee? Then shall he answer them, saying, Verily I say unto you, Inasmuch as ye did it not to one of the least of these, ye did it not to me. And these shall go away into everlasting punishment: but the righteous into life eternal."
EGW directly quotes Matthew 25:41-46 to illustrate the consequences of neglecting the needs of others.