How to Hide Ultimate Addons for Gutenberg Admin Menus

function plt_hide_ultimate_addons_for_gutenberg_menus() {
	//Hide the "Settings → UAG" menu.
	remove_submenu_page('options-general.php', 'uag');
}

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

Where do I put this code?