"The apostle's words were written for the instruction of believers in every age, and they have a special significance for those who live at the time when “the end of all things is at hand.” His exhortations and warnings, and his words of faith and courage, are needed by every soul who would maintain his faith “steadfast unto the end.” Hebrews 3:14 . AA 518.1"
"For we are made partakers of Christ, if we hold the beginning of our confidence stedfast unto the end;"
Ellen White directly references Hebrews 3:14 in this passage.
"The apostle sought to teach the believers how important it is to keep the mind from wandering to forbidden themes or from spending its energies on trifling subjects. Those who would not fall a prey to Satan's devices, must guard well the avenues of the soul; they must avoid reading, seeing, or hearing that which will suggest impure thoughts. The mind must not be left to dwell at random upon every subject that the enemy of souls may suggest. The heart must be faithfully sentineled, or evils without will awaken evils within, and the soul will wander in darkness. “Gird up the loins of your mind,” Peter wrote, “be sober, and hope to the end for the grace that is to be brought unto you at the revelation of Jesus Christ; ... not fashioning yourselves according to the former lusts in your ignorance: but as He which hath called you is holy, so be ye holy in all manner of conversation; because it is written, Be ye holy; for I am holy.” AA 518.2"
"Keep thy heart with all diligence; for out of it are the issues of life."
The EGW passage discusses guarding the avenues of the soul and preventing evil from entering the mind. Proverbs 4:23 directly states the importance of keeping the heart with all diligence because it is the source of life. The EGW passage expands on this principle, explaining how to practically apply it.
"Finally, brethren, whatsoever things are true, whatsoever things are honest, whatsoever things are just, whatsoever things are pure, whatsoever things are lovely, whatsoever things are of good report; if there be any virtue, and if there be any praise, think on these things."
Both passages discuss the importance of controlling one's thoughts and focusing on what is good and pure. While Philippians 4:8 provides a list of positive things to think about, and the EGW passage focuses on avoiding negative influences, the underlying principle of guarding the mind is the same.