David stopped the plague in Israel by building an altar for Yahweh and sacrificing burnt offerings and fellowship offerings on it.