How to Hide Better Messages Admin Menus

function plt_hide_bp_better_messages_menus() {
	//Hide "Better Messages".
	remove_menu_page('bp-better-messages');
	//Hide "Better Messages → Settings".
	remove_submenu_page('bp-better-messages', 'bp-better-messages');
	//Hide "Better Messages → Chat Rooms".
	remove_submenu_page('bp-better-messages', 'edit.php?post_type=bpbm-chat');
	//Hide "Better Messages → AI Chat Bots".
	remove_submenu_page('bp-better-messages', 'edit.php?post_type=bm-ai-chat-bot');
	//Hide "Better Messages → Administration".
	remove_submenu_page('bp-better-messages', 'better-messages-viewer');
	//Hide "Better Messages → Contact Us".
	remove_submenu_page('bp-better-messages', 'bp-better-messages-contact');
	//Hide "Better Messages → Add-Ons".
	remove_submenu_page('bp-better-messages', 'bp-better-messages-addons');
	//Hide "Better Messages → Upgrade".
	remove_submenu_page('bp-better-messages', 'bp-better-messages-pricing');
}

add_action('admin_menu', 'plt_hide_bp_better_messages_menus', 1000000000);

Where do I put this code?