By default, we do not have a specific setting that will hide the View Source of your WordPress website. However, you ma use a 3rd party plugin that has the capabilities to hide the View Source of your site. The plugin is called Disabled Source, Disabled Right Click, and Content Protection.
Just to set your expectation, this plugin is a third-party plugin which we are not able to guarantee support and compatibility as we have not fully tested them. However, you are free to try.