The very next verse (Philpippians 4:7) tells us the result of going to God with everything that makes us anxious. "And the peace of God, which transcends all understanding, will guard your hearts and your minds in Christ Jesus." That peace is what I need! I love the thought of peace standing guard between my heart and my mind, turning away the thoughts that trouble me.
Philippians 4:8 tells us just what we need to do with those thoughts. "Finally, brothers and sisters, whatever is true, whatever is noble, whatever is right, whatever is pure, whatever is lovely, whatever is admirable—if anything is excellent or praiseworthy—think about such things." As peace is turning away the troubling thoughts, we are to generate new thoughts - godly thoughts - thoughts that will not cause us to dwell on the things that are making us anxious.
Finally, Paul finishes with this direction, "Whatever you have learned or received or heard from me, or seen in me—put it into practice." Paul doesn't leave us thinking that all of this happens magically. He knows that we are human like him, therefore we will continue to have thoughts and situations that will make us anxious. The only way to overcome this is by the grace of God AND practice. We must be intentional about following these directions. And if we do, Paul tells us what will happen, "And the God of peace will be with you."