This set of verses is a common exhortation quoted and printed on cards. This wonderful encouragement is not just so that we have happy thoughts, but it is an important part of leading righteous lives. The verse directly before 8 and 9, expands on what this action of “[thinking] about such things” accomplishes:
“And the peace of God, which transcends all understanding, will guard your hearts and your minds in Christ Jesus.”
Our words and actions are a direct result of the thoughts in our heads. If we guard our thoughts well and preserve them in righteousness, then our actions and words follow suit. When we do this we are secure in the Lord and in His peace.
Take this quote from a conversation with Brother Lawrence in Practice of the Presence of God, “He told me that the foundation of the spiritual life in him had been a high notion and esteem of God in faith; which when he had once well conceived, he had no other care at first but faithfully to reject every other thought, that he might perform all his actions for the love of God.
The purpose of guarding our thoughts is not to empty our minds like Eastern philosophy teaches, but instead to keep our gaze fixed on the Lord. He is the only one who is wholly true, noble, right, pure, lovely, admirable, excellent, and praise-worthy. With Him at our center we receive peace and righteousness. Without this, we cannot put the ways of the Lord into practice.
Choose an attribute of God that you want to understand more. Maybe you are feeling fear, so you need more of His love, or feeling unsteady and you need more of His steadfastness. Whatever we lack, He has in abundance. Once you choose this attribute, find a passage that focuses on that attribute of God. Write it down somewhere, high-light it in your Bible, or memorize it- whatever you need to do to keep your thoughts on who God is. Below are some passage suggestions:
Unchanging: Psalm 90:1-2
Merciful: Luke 15
Great: 1 John 4:4
Loving: Romans 8:37-39