"For as he thinketh in his heart, so is he..." Proverbs 23:7a
The Bible tells us to guard our hearts. Whatever gets into your heart, whether it is good or bad, does so by gaining access. Therefore, we must guard our hearts. How do we guard them? How do we stop what is bad from gaining access? The access point to your heart is a door. You stop access by putting a "guard" on the door to your heart. What is the door that leads to your heart? It is your mind. Your mind is the door to your heart.
When bad, evil, wicked, wrong, ungodly, negative, unkind, fearful, hateful thoughts come, you have to take them captive or else they will gain entrance into your heart. They will come right in through the door. You will be letting them in.
When these thoughts come, capture them and cast them down. Don't give place to them. Don't hold the door open to them. Close the door. Close it by renewing your mind. Counteract those thoughts with the Word of God. Use your "sword of the Spirit" against them. Post God's Word at the door. This is what Jesus did in the wilderness. The enemy was trying to gain access to His heart. He was trying to find an open door into His heart. He used thoughts that would promote pride and lust. (Matthew 4) But Jesus guarded His heart and shut the door each time to the enemy by capturing His thoughts and renewing His mind with God's Word-- "it is written". You and I have to do the same. This is how we protect and guard our hearts. We close the door. The mind is the door. We close it by renewing it with God's Word.
Have a great day. Close the door of your heart-- stop holding it open.