This Book of the Law (Hebrew torah, meaning "instruction") probably refers to the book of Deuteronomy (see Deuteronomy 4:44; 29:21; 30:10; 31:9–12). It includes Israel’s foundational law codes and God’s moral and spiritual instruction.
God commanded Joshua to think about and speak God’s instruction day and night. This command means that Joshua was to focus on it continually (compare Deuteronomy 6:6–7; 17:18–20).