These two clauses mean basically the same thing and emphasize that Yahweh had chosen David to be king. (See: [[rc://en/ta/man/translate/figs-parallelism]])
Here ruling over the people is spoken of as shepherding them. AT: "You will care for my people Israel" or "You will rule over my people Israel" (See: [[rc://en/ta/man/translate/figs-metaphor]])