There are two possible options to exclude some categories from the menu. First one - disabling a category from displaying in the top menu individually with the setting Included in Menu:
Or, in order to hide the subcategories block, you can use the following setting: