In Ex 19:23 the consecration of Mt. Sinai by establishing boundaries around it served to keep out all that might have profaned God’s holy presence.
The separation of men from what defiles ceremonially is but typical of the holiness that is spiritual and ethical. “Be ye holy for I am holy” is quoted from the OT (I Pet 1:16; Lev 19:1; 20:7, etc.) and the so-called holiness code is heavily ethical. “Man was made in the image of God and capable of reflecting the Divine likeness. And as God reveals himself as ethically holy, he calls men to a holiness resembling his own” (ISBE, “Holiness”).
Joshua’s message to the people (v. 5). This was both an order and a promise, and the fulfillment of the promise depended on their obedience to the order. Some of God’s promises are unconditional, and all we have to do is believe them; while other promises require that we meet certain conditions. In meeting these conditions, we’re not earning God’s blessing; we’re making sure our hearts are ready for God’s blessing.