Deuteronomy 6:18

18 Do what is right and good in the Lord's sight, so that you may prosper and so that you may enter and possess the good land the Lord your God swore to [give] your fathers,

Deuteronomy 6:18 Meaning and Commentary

Deuteronomy 6:18

And thou shalt do that which is right and good in the sight of
the Lord
And what is such appears from the declaration of his mind and will in the commandments he has given, and obeying which is therefore doing what is right and good; for his commandment is holy, just, and good, being agreeable both to his nature and will, ( Romans 7:12 ) that it may be well with thee; as it is with those that fear God, and keep his commandments:

and that thou mayest go in and possess the good land which the Lord
sware unto thy fathers;
to give to them and to their posterity, even the land of Canaan; but if they did not what was right and good in the sight of God, they might expect to be kept out of it, as their immediate parents were, whose carcasses fell in the wilderness.

Deuteronomy 6:18 In-Context

16 Do not test the Lord your God as you tested [Him] at Massah.
17 Carefully observe the commands of the Lord your God, the decrees and statutes He has commanded you.
18 Do what is right and good in the Lord's sight, so that you may prosper and so that you may enter and possess the good land the Lord your God swore to [give] your fathers,
19 by driving out all your enemies before you, as the Lord has said.
20 "When your son asks you in the future, 'What is the meaning of the decrees, statutes, and ordinances, which the Lord our God has commanded you?'
Holman Christian Standard Bible ® Copyright © 2003, 2002, 2000, 1999 by Holman Bible Publishers.  Used by permission.  All rights reserved.