In contrast to the visual editor in WordPress, you can not disable the HTML editor. WordPress does not provide a user setting or a global option. Also, there is no hook, to disable the HTML tab above the editor when writing posts or pages.

But there are users who do not need this tab and like to deactivate it globally. Therefore, I have a solution, how you can disable it in your editor.
Alternatively, you can use the Plugin Adminimize, which offers such a possibility per role, just put it in the settings.
Since there is no hook or an option, you have to hide the area via CSS. This has the disadvantage that, while the tab is no longer visible, but if the cookie or a Plugin says to enable HTML, the editor has a problem showing us either the two editor tabs simultaneously, or no buttons. You need to explicitly set the editor.
In our first step we hide via CSS the tab and the buttons of the HTML editor. This stylesheet must be loaded in the admin, while you can go several ways: either you write it in the header (Hook admin_head) or load an external css via functionwp_enqueue_style().
The better way is you hide the tab via JavaScript and load this on the Hook admin_footer.
In a further step you must set the default editor, therefore you can use a hook and function, which sets the default to the valuetinymce.
Alternatively, a snippet for the implementation in Plugins or Themes.
This stylesheet must be loaded in the admin, while we can go several ways.
html editors are very important when we need any inner style sheet or embed code added means we need html editor . If you web design stuff you can really play with that html
Yeah I also feel that HTML editor should not be removed but it is for beginners as well as there are some who really don’t like this.
Everyone likes it because the webpage basic coding is HTML.. so people loves it