The mind is an awesome instrument of God. Yet He places it in frail humans. We are given control over what we think and how we react to those thoughts. Mental images flood our mind, often driven by those things we chose to observe with our eyes and ears. That is why Paul taught so strongly of the importance of keeping our minds focused on God and His Kingdom.
Science says that we use only about 10% of our mental ability. That's probably a good thing when it comes to the things of God, because we surely would be unable to comprehend the vastness of His love for us. I Corinthians 2:9 says, "...Eye has not seen, nor ear heard, nor have entered into the heart of man the things which God has prepared for those who love Him." Yet we all too often choose to dwell on those things which cause us the most pain and sorrow. Yes, they are a part of life, but so is Heaven. And soon this life will be over and Heaven's never-ending joy will consume us.
So when you mind turns to thoughts uncomfortable, ask the Holy Spirit to help you look on things of God, who for the joy that was set before Him, endured His cross...and yours. (Hebrews 12:2)