1Peter 3:10-12 For, "Whoever would love life and see good days must keep his tongue from evil and his lips from deceitful speech. He must turn from evil and do good; he must seek peace and pursue it. For the eyes of the Lord are on the righteous and his ears are attentive to their prayer, but the face of the Lord is against those who do evil."
Here Peter is quoting Psalm 34:12-16, which goes on to say, "The righteous cry out, and the LORD hears them; he delivers them from all their troubles.The LORD is close to the brokenhearted and saves those who are crushed in spirit. A righteous man may have many troubles, but the LORD delivers him from them all; he protects all his bones, not one of them will be broken. Evil will slay the wicked; the foes of the righteous will be condemned. The LORD redeems his servants; no one will be condemned who takes refuge in him." Ps 34:17-22
This is a proverbial truism not only concerning our present life, but our eternal life. Christ suffered and died at the age of about 33 and yet the prophecy says, "it was the LORD's will to crush him and cause him to suffer, and though the LORD makes his life a guilt offering, he will see his offspring and prolong his days, and the will of the LORD will prosper in his hand. After the suffering of his soul, he will see the light of life and be satisfied" Is 53:10,11a Life doesn't end at physical death, and thus even if one dies through unjustified suffering, there is still compensation. It was true of Christ and it is true of all who suffer unjustly.
So leave off revenge and bitterness. "God is just: He will pay back trouble to those who trouble you" 2Thess 1:6 and "Do not take revenge, my friends, but leave room for God's wrath, for it is written: "It is mine to avenge; I will repay," says the Lord. Rom 12:19
Verse 12 is a transition into next section in which Peter will elaborate on the concept of responding properly to persecution. His point here is to reckon that God is watchful and aware and empathetic for his children. A common effect that those who are persecuted experience is a sense of abandonment. When Jesus was on the cross he empathized with people in such situations in quoting the first verse of Psalm 22, "My God, My God, Why have you forsaken me?" And we read such things in David's Psalms and in the book of Job. Peter's words are an encouraging reminder that though the world hates us, God doesn't.