How to Hide Rank Math SEO Admin Menus

function plt_hide_seo_by_rank_math_menus() {
	//Hide the "Tools → Scheduled Actions" menu.
	remove_submenu_page('tools.php', 'action-scheduler');
	//Hide the "Rank Math" menu.
	remove_menu_page('rank-math-registration');
}

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

Where do I put this code?