Read this passage and open each verse for the full verse feed and commentary tools.
15you shall surely set him king over you, whom Yahweh your God shall choose: one from among your brothers shall you set king over you; you may not put a foreigner over you, who is not your brother. 16Only he shall not multiply horses to himself, nor cause the people to return to Egypt, to the end that he may multiply horses; because Yahweh has said to you, You shall henceforth return no more that way. 17Neither shall he multiply wives to himself, that his heart not turn away: neither shall he greatly multiply to himself silver and gold.
18It shall be, when he sits on the throne of his kingdom, that he shall write him a copy of this law in a book, out of [that which is] before the priests the Levites: 19and it shall be with him, and he shall read therein all the days of his life; that he may learn to fear Yahweh his God, to keep all the words of this law and these statutes, to do them;
Deuteronomy 17:15-19 (WEB)