Tips on Customizing Template Manager for Gutenberg Block

How to Hide Gutenberg Template Manager Admin Menus

function plt_hide_template_manager_menus() {
	//Hide the "Templates" menu.
	remove_menu_page('edit.php?post_type=templates');
	//Hide the "Templates → Templates" menu.
	remove_submenu_page('edit.php?post_type=templates', 'edit.php?post_type=templates');
	//Hide the "Templates → Add New Template" menu.
	remove_submenu_page('edit.php?post_type=templates', 'post-new.php?post_type=templates');
}

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

Where do I put this code?

How to Hide the "Template Settings" Meta Box

function plt_hide_template_manager_metaboxes() {
	$screen = get_current_screen();
	if ( !$screen ) {
		return;
	}

	//Hide the "Template Settings" meta box.
	remove_meta_box('gtm_custom_meta_box', $screen->id, 'normal');
}

add_action('add_meta_boxes', 'plt_hide_template_manager_metaboxes', 20);