John 6:39
I should lose nothing - It is the will of God that every soul who believes should continue in the faith, and have a resurrection unto life eternal. But he wills this continuance in salvation, without purposing to force the persons so to continue. God may will a thing to be, without willing that it shall be. Judas was given to Christ by the Father, Joh_17:12. The Father willed that this Judas should continue in the faith, and have a resurrection unto life eternal: but Judas sinned and perished. Now it is evident that God willed that Judas might be saved, without willing that he must be saved infallibly and unconditionally. (Adam Clarke)
John 10:28
They shall never perish - God hath given unto them eternal life, and this life is in his Son; and he that hath the Son hath life, 1Jn_5:11, 1Jn_5:12. Now it is evident that only those who have Christ living in and governing their souls, so that they possess the mind that was in him, are his sheep - are those that shall never perish, because they have this eternal life abiding in them: therefore to talk of a man’s being one of the elect - one that shall never perish - one who shall have eternal life - who shall never be plucked out of the hand of God, etc., while he lives in sin, has no Christ in his heart, has either never received or fallen away from the grace of God, is as contrary to common sense as it is to the nature and testimonies of the Most High. Final perseverance implies final faithfulness - he that endures to the end shall be saved - he that is faithful unto death shall have a crown of life. (Adam Clarke)
The condition is that he remains faithful and endures to the end.