Possible meanings are 1) Moses is calling on all those who live in heaven and earth to be witnesses to what he says or 2) Moses is speaking to heaven and earth as if they are people, and he is calling them to be witnesses to what he says.
"but Yahweh will destroy many of you". As indicated in the next verse, not every Israelite will be killed. Here "completely destroy" is a generalization and emphasizes that many of the Israelites will die.