To cover most requirements, and to do so safely from a security standpoint, meet SEO and accessibility standards, etc., you can use one of the three editors available in Publii: WYSIWYG editor, Block editor, or Markdown editor. For me personally, I mostly tend to use WYSIWYG editor mainly because it’s what I’m used to and seems most flexible to me.
The WYSIWYG editor toolbar covers most requirements to enter content into your pages: text, images, galleries, videos, files, etc. By using the buttons and commands on the editors, perhaps one of the core ideas is to help protect non-technical users.
To enter any HTML code or javascript directly into pages could introduce security risks or cause other problems. But for users who understand the risks, if you want more or have greater flexibility, check out in Publii: Site Settings > Advanced Options > Editors > WYSIWYG editor.
More details at: https://getpublii.com/docs/website-settings.html#editors
If you want to add custom config and JavaScript to your editor directly to theme, check out: https://getpublii.com/dev/how-to-add-custom-config-or-js-for-post-editor/
You can also search in this forum for more past answers and solutions.