How to Hide the "Simple NoAI Options" Admin Menu

function plt_hide_simple_noai_and_noimageai_menus() {
	//Hide the "Settings → Simple NoAI Options" menu.
	remove_submenu_page('options-general.php', 'noai');
}

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

Where do I put this code?