The apostle quotes Ps. 34 giving a recipe for enjoyment while in this life. God wants to bless us and tells us how to find the blessed life.
1Peter 3.10-12 corresponds to Ps. 34.12-16. Here are the two sections from the ESV:
“Whoever desires to love life
and see good days,
let him keep his tongue from evil
and his lips from speaking deceit;
let him turn away from evil and do good;
let him seek peace and pursue it.
For the eyes of the Lord are on the righteous,
and his ears are open to their prayer.
But the face of the Lord is against those who do evil.” (1Peter 3.10-12)
What man is there who desires life
and loves many days, that he may see good?
Keep your tongue from evil
and your lips from speaking deceit.
Turn away from evil and do good;
seek peace and pursue it.
The eyes of the Lord are toward the righteous
and his ears toward their cry.
The face of the Lord is against those who do evil,
to cut off the memory of them from the earth.