It is a credit to you if, being aware of God, you endure pain while suffering unjustly. If you endure when you are beaten for doing wrong, what credit is that? But if you endure when you do right and suffer for it, you have God's approval. For to this you have been called, because Christ also suffered for you, leaving you an example, so that you should follow in his steps. "He committed no sin, and no deceit was found in his mouth." When he was abused, he did not return abuse; when he suffered, he did not threaten; but he entrusted himself to the one who judges justly. He himself bore our sins in his body on the cross, so that, free from sins, we might live for righteousness; by his wounds you have been healed. (1 Peter 2:19-25, NRSV)
For this is thankworthy, if a man for conscience toward God endure grief, suffering wrongfully. For what glory is it, if, when ye be buffeted for your faults, ye shall take it patiently? but if, when ye do well, and suffer for it, ye take it patiently, this is acceptable with God. For even hereunto were ye called: because Christ also suffered for us, leaving us an example, that ye should follow his steps: Who did no sin, neither was guile found in his mouth: Who, when he was reviled, reviled not again; when he suffered, he threatened not; but committed himself to him that judgeth righteously: Who his own self bare our sins in his own body on the tree, that we, being dead to sins, should live unto righteousness: by whose stripes ye were healed.. (1 Peter 2:19-25, KJV)
More advice for slaves. But in this section, Peter specifically ties their suffering to that of Jesus. If you're beat up for something you didn't do, then God has your back—after all, that's what happened to his son. The Almighty has a soft spot for the wrongfully accused.