Extending the most voted answer, now there is an extension to achieve what is described there to toggle quickly in a GUI way. It's called Explorer Exclude. You can install this with this command:
ext install RedVanWorkshop.explorer-exclude-vscode-extension
Demo: