In verse 18, Peter covers a situation regarding a person's employment.
Our boss takes advantage of us. He doesn't pay us what we are worth. He makes us work longer hours than we feel that we should. He puts the pressure on in regard to the Sabbath or Holy Days or to keeping the Feast of Tabernacles. He gives us the kind of work that is beneath our dignity. He gives us the kind of work for which we are overqualified and we don't feel challenged. There all kinds of ways we can feel pressure from employers.
In these kinds of situations, Peter is not saying we should not compromise at all. He is saying for the Lord's sake, that is, out of regard for Him, we are to control ourselves so we don't rebel. To allow our emotions to have free reign to the point of rebellion is the same as calling God into account—that is, we are (at least indirectly) telling Him that He doesn't know how to run His creation.
Before we leave this section, I want us (you and me) to understand that what is commendable here—mentioned in verse 19—is NOT going through the suffering, but the devotion to God is what is commendable. When we couple that with the going through suffering, then that is commendable. But it is really the devotion to God that Peter wants us to focus on. We do this (going through the pain, going through the trouble) because of our respect for God.
Now, think about Jesus again—that He did not revile. Think of the awesome powers of discernment that He had! It says in another place in the scriptures that He knew what was in the heart of men. He undoubtedly (as we would say today) "had the goods on" those people—on those who were reviling Him. But "He opened not His mouth." Instead, He lived within the limits of His human authority.