You can take down your website and block anyone but you from visiting it. If that’s not an option, there is not much you can do.
Websites work by sending the web page and any linked assets to the browser, where they browser may render them. Most browsers also offer tools to inspect what content is being sent by the website. This is done on the device of the visitor, and is not something you have any control over as a website owner.
Some website owners choose to block right clicks and the F12 key to make it harder to open the developer tools. But then people can still open it from the browser menus, so it’s just obnoxious for people who want to right click a link for example without adding any security.
Also, the “directory browser” only exposes files that you have linked to from the web page. Browsers can’t automagically find all the files in a folder.