Joshua is about to turn over the control of the nation at the point of his death. He gathers the leaders, priests, and elders together. In the moments which pass, he gives them sound advice on how God expects them to live in the land they have been given. His first piece of advice: Stay alert! Why? It was because the work was not done - nations still had to be dealt with. His second piece of advice: Stay strong and steady! Why? There would be much influence around them to do what would get them into big trouble. In warning them to stay strong and steady, he is advising them on living by the principles God set out in his word. Then he comes to this third piece of advice:
"Now, vigilantly guard your souls: Love God, your God. Because if you wander off and start taking up with these remaining nations still among you (intermarry, say, and have other dealings with them), know for certain that God, your God, will not get rid of these nations for you. They'll be nothing but trouble to you—horsewhips on your backs and sand in your eyes—until you're the ones who will be driven out of this good land that God, your God, has given you." (Joshua 23:11-13 The Message)
This probably sums it up very well for not only Israel, but for us! We need to vigilantly guard our souls - because we have a tendency to wander when we are not paying attention! Look at the consequences of being a little lax in dealing with the nations around them - God would not get rid of them for them! If they dabbled with them, God wanted them to know how much trouble they would bring into their lives - like horsewhips on their backs and sand in your eyes.
Now, I have never been horsewhipped, but I have had sand in my eyes. I know how painful this is - but not only is it painful, it is downright impossible to see right! I spend so much time trying to rid myself of the irritating stuff in my eye, I cannot see what is right in front of me. What Joshua may be saying to us is to be aware of just how much even one compromise (one grain of sand) can impact our vision!
When one is vigilant, they are so keenly aware of their surroundings - no influence escapes them. Why? They are "on alert" - sensing danger. I think is probably the crux of what Joshua is trying to explain to us. If we don't get anything else, we should get this: God has our back, but he doesn't want us to be fooled or duped by the influences around us. We only get duped when we are not paying close attention.
The purpose of a horsewhip is to control the actions of the horse. You don't take one in hand if you don't think you'll have to use it. In a sense, Joshua is reminding us of the influences of belief systems, traditions, and the prevailing fads of the day. They have a tendency to become things which can "control" us much like a horsewhip can can control the horse. Look again at the passage. Joshua says, "If you wander off and start taking up with them..." In essence, he is describing the kind of lackadaisical kind of action on our part which gets us into the deepest kinds of trouble - all while we are seemingly unaware!
The horse will wander the fields, leisurely taking in what is in front of it. The danger is in not being discriminating in what is taken in! Some things a horse may take in may not be the best for its digestive system - the old cowboy shows used to call it "wacky weed". It would make the horses downright miserable. Guess what? When we "take in" stuff without really thinking it through, we may be downright miserable, too!
So, Joshua describes two "actions" which result in two "outcomes". First, one action really comes as a matter of "inactivity" - we wander right into the things God has plainly said to stay away from. The outcome is feeling like a whip has been taken to our backs - we feel controlled! The second action is really one of getting stuff "into" us which really doesn't have a place in us. The outcome is evident in the effect it has on our ability to see clearly (sand in the eye). Either way, neither of these outcomes is desirable. So, we'd do well to listen to the warning Joshua gives. Be alert. Stay strong and steady - not veering from the Word of God. Be vigilant - your enemy is waiting to lure you in.