"And we take captive every thought to make it obedient to Christ." ~2 Corinthians 10:5b (NIV).
Taking captive EVERY THOUGHT. Every thought meaning every single thing that passes through our brains. Good and bad. Right and wrong. When we have any sort of thought, put it to test of whether it is obedient to Christ: "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." ~Philippians 4:8 (NIV).
When I begin to feel lonely, or miss an old relationship, I will take these thoughts captive, and turn them into obedience: God led me to where I am in life right now, and I listened for His guidance when making decisions in past relationships. Proverbs 3:5-6 tells us, "Trust in the Lord with all your heart, and do not lean on your own understanding. In all your ways acknowledge Him, and He will make straight your paths" (ESV). Whenever I begin to think about how I miss someone or miss a relationship, I will stop and turn my focus back towards God.