We can find this foundation in Matthew 7:24-27.
A solid foundation is built by knowing Jesus who embodies the truth, and on hearing and doing the sayings of Jesus.
Where do we find the only recorded words of Jesus? In the Bible, and more specifically, in the four gospels.
At this point, some may already be questioning this, because only four of sixty six books contain sayings attributed directly to Jesus. If that is so, does that mean we stand against powerful spiritual wickedness and build our entire spiritual foundation on a mere fraction of the Bible?
The answer is, "absolutely not." It is crucial that the right foundation be laid--other wise, we imperil, not only, ourselves but those within our spheres of influence as well. Every word spoken by almighty God recorded in the scriptures can be considered a saying of Jesus, because all of scripture is God-breathed, and the scriptures record that Jesus Christ is the Creator--The Almighty Himself.
The entire Bible is the Word of God, and it is that to which Jesus was referring when he said everyone who heard and did his sayings would be on safe and solid ground. So, in girding our lions with the truth, we must first become acquainted with the Word of God (Isaiah 8:20 To the law and to the testimony if they speak not according to this word it is because there is no light in them), and then be obedient to what it says.
Jesus claimed the Word of God was TRUTH (John 17:17). The Written Word of God is the only TRUTH. When Satan confronted Jesus with FACTS, Jesus countered facts with written TRUTH (He said, "It is written..."). Facts and TRUTH are not always synonymous (although sometimes they are, see Matthew chapter four).
What do we do if the facts of our situation contradict the truth of the written Word of God? The scriptures say it is always proper to trust in what the Word of God says and not in what our own limited and finite understanding tells us (Proverbs 3:5).
The Word of God (TRUTH) also says the scriptures need to be rightly divided (that means correctly discerned [2 Timothy 2:15]). Note that in 2 Timothy 2:15, The apostle calls the scriptures, "The Word of TRUTH." There is no other TRUTH than that which is written, and the prophet Isaiah said that if anyone tries to say differently, then there is NO LIGHT in them (Isaiah 8:20).
No matter what the enemy throws at us, no matter what situation we may find ourselves in, the Word of God is Truth we can stand on. There is always an answer to be found there. And only by standing in (hearing and doing) the Word of TRUTH, can victory be obtained.
That means we must first know Jesus personally, as He is the truth. And we must master a thorough understanding of what the Bible says (and what it does not say) by reading it for ourselves, not just by reading what someone else says about it.
Read the Bible every day--always picking up today where you left off yesterday. If you are just starting out, the Book of John is a good place to begin.