I’ll try to rephrase: The way “classic” WordPress themes work, you’ll typically have some PHP file that is processed and which outputs the “header portion” of every page that gets generated. In most cases, the name of that file is header.php.
Kathryn also commented that in a theme that may get updated at any time, you should avoid editing your theme files, since these changes will disappear whenever the theme gets updated. (When WordPress updates a theme or a plugin, it deletes its whole directory and replaces it with the new version.) But one could still make some customization like this using a child theme. That may be what you did before with the theme you used before.
Now, Twenty Twentytwo is a totally different type of theme. Starting from version 5.9, WordPress started rolling out “Full Site Editing”, where the “Customizer” is replaced with a block-building experience. Themes of this type are built in a very different way, and they don’t have any “header.php” file that you could try to overrule in a child theme. If you need to add any specific HTML snipped inside the HEAD tags, the best way will be to tie your content to the corresponding hook. And that is the way a plugin would do it.
At least for now, there is no convenient setting to just add such a thing directly in WordPress core.