In both chapters John is attempting to impress one thing that reflects upon two aspects of a Christian’s life: our prayer life and rewards or loss thereof at Christ’s coming. John wants us to possess a confidence at Christ’s sudden appearing, ensured by what he refers to as “abiding in Him.” Likewise, the apostle commands that a Christian keep Christ’s commandments to love one another and believe on the Savior (1st John 3:23-24); such things are pleasing in His sight. If we wish to have power in prayer we must abide in Him. We do this by keeping our first love alive, Revelation 2:4. Our first love is Christ Himself, and being active and fervent in doing the things that please Him will result in the natural outcome of possessing a potent prayer life and not having to worry about being ashamed at His coming. The church of Sardis was in danger of suffering the very thing John was presently warning Christians of, Revelation 3:3. Jesus was mercifully warning them (and through them, us) that their conduct was unbecoming of saints, and they would not presently want to be openly found by their Lord.
To clarify further, the apostle makes two clear declarations about the nature of the salvation offered to mankind. “[God] hath saved us, and called us with an holy calling, not according to our works, but according to his own purpose and grace, which was given us in Christ Jesus before the world began,” 2nd Timothy 1:9. So the saints are called and saved by God’s prerogative, not man’s initiative or effort. “But after that the kindness and love of God our Saviour toward man appeared, Not by works of righteousness which we have done, but according to his mercy he saved us, by the washing of regeneration, and renewing of the Holy Ghost,” Titus 3:4-5. Again Paul confirms that salvation has nothing to do with our works but with God’s mercy (aka grace). Note that Paul refers to salvation or justification in the past tense, including himself in the context with the usage of the word “we.” Salvation from sin’s penalty is not a future state to be enjoyed after suffering and working for one’s salvation; it is an immediate and permanent gift from God bestowed upon those who trust in Jesus Christ alone for it. “God hath saved (past tense) us.”