That’s done on the server. If it’s running Linux, use a .htaccess file, if it’s on Windows, contact the system admin. The poor man’s way of doing it is just to put a blank index.html file in each directory you don’t want access to.
I know for my brother’s website there was just an option in the sites control panel which I just came across and so selected. I think the servers run linux so I’m sure it just does the .htaccess for you.