Bunyan struggled to find assurance and victory for many years. Finally one day a voice spoke to him from heaven, which changed everything. To read the full story of his conversion read Grace Abounding to the Chief of Sinners.
“Suddenly this sentence fell upon my soul, ‘Thy righteousness is in heaven.’ and me thought, with awe, I saw, with the eyes of my soul, Jesus Christ at God’s right hand; there, I say, was my righteousness; so that wherever I was, or whatever I was doing, God could not say of me, He wants my righteousness, for that was just before him. I also saw, moreover, that it was not my good frame of heart that made my righteousness better, nor yet my bad frame that made my righteousness worse; for my righteousness was Jesus Christ himself, ‘the same yesterday, to day, and forever.’ Hebrews 13:8
Now did my chains fall off my legs indeed. I was loosed from my afflictions and irons; my temptations also fled away; so that from that time those dreadful scriptures of God left off to trouble me....
Oh! me thought, Christ! Christ! There was nothing but Christ that was before my eyes. I was not now only for looking upon this and the other benefits of Christ apart, as of his blood, burial, or resurrection; but considering him as a whole Christ, as he in whom all these and all other virtues, relations, offices and operations met together, and that he sat on the right hand of God in heaven. It was glorious to me to see his exaltation, and the worth and prevalency of all his benefits....
“Further, the Lord did also lead me into the mystery of union with the Son of God (Eph. 5:30 “For we are members of his body, of his flesh, and of his bones.”).... By this also was my faith in him, as my righteousness, the more confirmed in me; for if he and I were one, then his righteousness was mine, his merits mine, his victory also mine. Now I could see myself in heaven and earth at once; in heaven by my Christ, by my head, by my righteousness and life, though on earth by my body or person.”—John Bunyan, Grace Abounding to to the Chief of Sinners