When he appears
John reminds his audience that Jesus is coming back. They are living in the "last hour." See "The last hour - 1 John 2:18" and "The Plan of the Ages: Are We in the Last Days?" below. "When he appears" refers to Christ's second coming. As Eaton says, "One day Jesus will come a second time, suddenly, unexpectedly, literally, visibly, personally, gloriously, triumphantly." Christians should strive (Phil 2:13; 1 Cor 15:10; Heb 13:21; cf. Rom. 12:3; 1 Cor. 12:6) to live in obedience to God to ensure that they need not be ashamed on the day of judgment, when each one will give an account (Rom. 14:12). See "Make every effort - Hebrews 4:11" and "Believers Living in the Light - 1 John 1:6-2:2" below.
There will be a visible and final return of Christ at the end of the age when he will come back as judge. Those who "continue in him" by continuing to trust in the Gospel message (1 John 2:24) need have no fear of condemnation (John 3:17-18). Compare 1 John 2:19. See "Sanctification: When Will I Stop Sinning?" and "The Perseverance and Preservation of Believers: Can I Lose My Salvation?" below.
when he appears… at his coming . John urges persevering obedience in anticipation of Jesus' second coming. On Jesus' parousia or arrival as king, see notes on Matt. 24:3, 27, 37, 39; 1 Cor. 15:23; 1 Thess. 2:19; 3:13; 4:15; 5:23; 2 Thess. 2:1, 8; Jas. 5:7-8. This is the only time John uses this word for Jesus' second coming, which evokes an image of an arriving dignitary or king who is welcomed by the local people. The word ashamed has to do with the disgrace God's enemies feel at judgment (see notes on Ps. 6:10; Zech. 9:5). Like Jesus, Peter and Paul, John taught that Christians will give an account of their deeds on the day of judgment (see notes on Matt 25:14-30, 31-46; Rom. 14:12; 1 Cor 12-15; 2 Pet 3:10-14). For God's enemies, the Day of the LORD is a day of terror (see notes on Amos 5:18-20). But those who abide in Christ (1 Jn. 2:24) will not be condemned (see notes on Jn. 3:17-18)