II Samuel 5: 17-25: "But when the Philistines heard that they had anointed David king over Israel, all the Philistines came up to seek David; and David heard of it, and went down to the hold. The Philistines also came and spread themselves in the valley of Rephaim. And David enquired of the LORD, saying, Shall I go up to the Philistines? wilt thou deliver them into mine hand? And the LORD said unto David, Go up: for I will doubtless deliver the Philistines into thine hand. And David came to Baal-perazim, and David smote them there, and said, The LORD hath broken forth upon mine enemies before me, as the breach of waters. Therefore he called the name of that place Baal-perazim. And there they left their images, and David and his men burned them. And the Philistines came up yet again, and spread themselves in the valley of Rephaim. And when David enquired of the LORD, he said, Thou shalt not go up; but fetch a compass behind them, and come upon them over against the mulberry trees. And let it be, when thou hearest the sound of a going in the tops of the mulberry trees, that then thou shalt bestir thyself: for then shall the LORD go out before thee, to smite the host of the Philistines. And David did so, as the LORD had commanded him; and smote the Philistines from Geba until thou come to Gazer."
"But when the Philistines heard that they had anointed David king over Israel, all the Philistines came up to seek David; and David heard of it, and went down to the hold."
When Satan learns of someone who is devoted to Christ, he will attack that Christian: either spiritually (a demon may attack you in your sleep), intellectually (an unbeliever or a false Christian may argue with you about your Christian beliefs) or physically (Satan may bring sickness or death to you or your loved ones).
What was David's reaction on hearing that the Philistines had invaded Israel? He immediately enquired of the Lord.
When we are attacked by the devil, we must not seek consolation or advice from flesh and blood. We must go to the Lord and ask Him what we must do. You can pray with words or enter into the Presence of God (when the Lord glorifies your body, this can defeat a tactic or strategy of the devil; "the anointing breaks the yoke of sin.") or pray in tongues. When trouble comes: seek God, not man.
After David sought the Lord, David went out and defeated the Philistines in battle. If you abide in Christ, the Lord will give you the strength and wisdom to defeat the devil. "No weapon formed against thee shall prosper."
"For then shall the Lord go out before thee."
Whenever we are attacked by the devil, we should think of it as an opportunity for the Lord to humiliate and defeat the devil in our life. It is an opportunity for the Lord to be glorified in our bodies. Whatever won't kill us, will only make us stronger. We need to let the Lord use our lives so that the Spirit of God can flow through us and defeat some aspect of Satan's kingdom.
As a living sacrifice, we need to do what the Lord wants us to do and NOT what we want to do. Self-will kills the power of the Holy Ghost in our lives. Self-will does not glorify God.