1 Peter 4 teaches us that the blood of Jesus Christ covers the sins of the flesh so that we are judged by the Spirit.
Peter says that as soldiers preparing for battle, we should arm ourselves with the same manner of thinking as Christ. Christ suffered in the flesh but was elevated in the Spirit. He says that "Anyone that has suffered in the flesh has ceased from sin." When we turn from keeping our minds focused on things of the flesh, we are no longer struggling to uphold human passions, but instead the will of God.
Legalism and works-righteous teachings are not a problem that has recently manifested its ugly head in this day. Most of the apostles battled against the teaching of the failed Law.
The Gentiles had already broken every rule in the book. Sensuality, passions, drunkenness, orgies, drinking parties, and lawless idolatry were the ways of the Gentile, and Peter gives hope that we are not judged by the things of our past. He said that others are surprised that you no longer want to join in their sin, and may even oppress you for your new-found faith.
Peter said that the Gospel was not only preached to the living, but also preached to the dead. Though the dead had been judged in the flesh, but the rules they kept and the Law they followed, they may now live in the Spirit the way that God does.
As Christians, we should not judge others by their outward appearance of holiness, God no longer judges by the flesh. God judges by the Spirit.
That same God, who can judge every person in the Old Testament who broke the Law according to their Spirit and not their failure can also represent you before His Father.