"What you think about will be what you long for and what you long for will be what you chase after." Ben Stuart
"Hold every thought captive to make it obedient to Christ" 2 Corinthians 10:5
"Out of the overflow of the heart the mouth speaks." Matthew 12:34
If you spend your time thinking about the Lord in daily Bible study and godly conversation in fellowship, He is what you will long for-for a relationship and for understanding of His scriptures and of Himself and for discernment of His will for your life-and when He is what you LONG for, really long for, you will chase after Him every chance you get!
On the otherhand, if you spend your time thinking on your jealousy, or the next time you can get drunk, or about how good you look, or how people view you/ your own reputation, or selfish ambition, or about sex or porn, these things you will chase after.
Check out Galatians 5:16-26 and then Ephesians 4:17-24. But dont think about it as longing for or chasing morality. Success in this area is not attained by longing to be righteouss, that is a mere side effect of thinking about/longing for/chasing after Him and a result of grace.
Pray "Search me, O God, and know my heart; test me and know my anxious thoughts. See if there is any offensive way in me, and lead me in the way everlasting." Psalm 139:23-4