How to Hide the "Yandex.Metrica" Admin Menu

function plt_hide_wp_yandex_metrika_menus() {
	//Hide the "Settings → Yandex.Metrica" menu.
	remove_submenu_page('options-general.php', 'yam_settings');
}

add_action('admin_menu', 'plt_hide_wp_yandex_metrika_menus', 11);

Where do I put this code?