Passage
This book of the law shall not depart from thy mouth; and thou shalt meditate upon it day and night, that thou mayest take heed to do according to all that is written therein; for then shalt thou have good success in thy ways, and then shalt thou prosper.
Nearby Context
Joshua 1:6 Be strong and courageous, for thou shalt cause this people to inherit the land which I have sworn unto their fathers to give them.
Joshua 1:7 Only be strong and very courageous, that thou mayest take heed to do according to all the law that Moses my servant commanded thee. Turn not from it to the right or to the left, that thou mayest prosper whithersoever thou goest.
Joshua 1:8 This book of the law shall not depart from thy mouth; and thou shalt meditate upon it day and night, that thou mayest take heed to do according to all that is written therein; for then shalt thou have good success in thy ways, and then shalt thou prosper.
Joshua 1:9 Have I not commanded thee: Be strong and courageous? Be not afraid, neither be dismayed; for Jehovah thy God is with thee whithersoever thou goest.
Joshua 1:10 And Joshua commanded the officers of the people, saying,
Study Lenses
The verse centers on "book", "shall", "depart", "mouth", "thou", "shalt", "meditate", and "upon". It is saying that the verse draws attention to "book" and "shall", so its meaning should be read from those terms before moving to application.
The nearby context moves from verse 7's "Only be strong and very courageous that..." into verse 9's "Have I not commanded thee Be strong...", so "book" and "shall" belong inside that flow. In Joshua context, the local focus is covenant, worship, and faithfulness.
A plain takeaway is to answer the verse's own emphasis on "book" and "shall" with trust shaped by these words, not by a vague optimism outside the passage.