What does the Bible mean by “My sons, think only of what is holy, what is honorable,” etc.?
Jesus taught, "The eye is the lamp of your body; when your eye is clear, your whole body also is full of light; but when it is bad, your body also is full of darkness" (Luke 11:34). It sounds confusing at first, but "light" is associated with righteousness and "darkness" is associated with evil. Your actions tend to follow the direction you are looking at. If you focus on righteousness then you tend to act righteously. If you focus on wickedness then you tend to act wickedly.
Thus, Paul tells Christians, "Finally, brethren, whatever is true, whatever is honorable, whatever is right, whatever is pure, whatever is lovely, whatever is of good repute, if there is any excellence and if anything worthy of praise, dwell on these things. The things you have learned and received and heard and seen in me, practice these things, and the God of peace will be with you" (Philippians 4:8-9). He is saying to focus on good things and put those things into practice in your life.