"To walk as He walked": this means to live and act, and in life and action to express inward properties and qualities like those of Christ. "Perfect love," he says, "is proved by works. But since it happens that someone seems outwardly to keep the commandments rightly and exactly, while his inward disposition is impure, and therefore he is far from God, the apostle says that one who has made himself God's own must also live as closeness to God requires" (Theophylact).
Christ left an example and pattern for how Christians should act in life (1 Pet 2:21), or how they should follow in His steps. Whoever abides inwardly in Him necessarily also walks, or strives to walk, in life and action as He walked. If he does not walk so, then he does not abide in Him. He is a liar, deceives himself, and the truth is not in him (1 Jn 1:6 and parallels).