How can I make my electrical box dustproof?
Use a weatherproof box and a weatherproof extension ring (or rings if you need a lot of depth) if you cannot find a weatherproof box to suit.
Or, just seal up the box with duct seal (non-hardening electrical putty for sealing up conduits.)
Unless you use a weatherproof switch enclosure (which may not be compatible with whatever absurdly deep switch you have chosen if it's not like a normal toggle switch at the mounting end) the switch itself will be an entry for dust into exactly the places you most don't want it.
Depending on the nature/purpose of the switch, enclosing the entire switch behind a gasketed door might be appropriate - but not if it's something that requires immediate access, like an emergency stop (though most of those are dust-resistant and/or waterproof, or available that way, anyhow.)
Addressing dust collection/control is another approach. It's not good to breathe that stuff, so getting it out of the air ASAP is good for you AND your electrical items.