When Joshua received these words from the Lord, the only “books” he had in hand were the five scrolls Moses had written down. Collectively, they taught Joshua where he came from and what was expected of him. They would provide for Joshua all the motivation and power he needed to succeed in what he was about to do, that is, to retake the Promised Land of Canaan for Israel. This is the historical context of this verse. This is all that Joshua was intended to learn from this instruction from God.
Is there a modern application of this verse? Certainly. But it must be limited to the following: 1) that the book of instruction is from the Lord (the Bible) and that the “whatever you do” is commanded by God, I.e., the great commission. This verse is not carte blanche for whatever you want to do or a license for iniquity. 2 Tim 3:17 talks about how the word of God equips the man of God for every good work. That is what God is saying here. The Word of God will equip to do the work to which He’s called you. That’s how it works, and it is a perversion of God’s purpose to make this fit your desires.
Before you take off running with any verse, you must first determine what it meant before you can determine what it means. This verse was not written to us, but for us. We have inherited all of those to equip us in the complex world in which we live. Why is the Bible so hard to understand? Because the world is. We need every verse.
God bless you today.