Anytime you are in sin, or not walking with God in all His ways (and it may be as simple as saying one word or phrase, like that just blows me away that can cause you problems) you open the door to the devil to mess with you. Remember the verse that says the devil is a roaring lion seeking whom He may devour.....its reality. The devil wants none of us to succeed in God. He wants people to think God is just a joke and not faithful or true to His Word (which we know are lies). So any opportunity to harass us in our minds, will, emotions, physical body, or even through others....he will take it.
The way to avoid being messed with is to walk in all God's ways, at all times and know how to use the Word of God to combat the attacks when they come. The devil puts a thought in your mind, if you don't take that thought captive like 2 Corinthians 10:5 says...it will mess you up, and if you let that thought come out of your mouth, it affects you even greater. If the devil attacks your body with a symptom...and you go around saying how much it hurts or how sick you are.....instead of saying that you are healed, you will be sick or have lots of pain. You may think this is just a bunch of nonsense, but try it. Test what i am saying. Here are two ways, 1) think something and then start to speak....the mind stops to hear what the mouth is speaking. 2) your in a bad mood, but start singing praises to God, see how fast your mood changes
We cannot be ignorant of the ways that the enemy attacks (mark 4, parable of the sower), or the ways that we trip ourselves up (choosing to not heed God's Word..ie...i don't want to hear that or choosing to not water (study) God's Word). Nor can we be ignorant of God's ways of doing things (walk in love and forgiveness at all times, and stay in communion with Him). If we don't follow God fully and submit to His ways....it will cause us greater problems, than had we just obeyed.
God has set before us life and death, blessings and curses....what do you choose? He desires that you choose life and blessings, but if you choose death and curses, He will not and cannot override your decision.