In John 16:8 we read that one aspect of the Holy Spirit’s work in our heart is to convict us of sin. The more we walk in the Spirit, the more sensitive we will be to His leading. Galatians 5:16.
Our desire should be that He will convict us of our evil thought before we speak it. Not every thought we have is of our own origin. When satan sends fiery dart lies, they often come in first person or accusations.
Ephesians 6:16 says that our shield of faith will quench the fiery darts. Hidden sin weakens our faith. We stand by faith (humility), but we fall from His grace as we entertain sin in our hearts (pride).
Whatever is in our heart seeps into our thought processes. We guard our heart by hiding God’s word in it. Psalm 119:11. It also is guarded with His peace by not being anxious, but rather praying with thanksgiving. Philippians 4:6-7.