Go to the space and choose Space tools > Overview from the bottom of the sidebar
Choose Edit next to Space Categories.
Under Space Categories, choose the x icon next to each category that you want to remove.
Right there you can also add the new categories.
If you delete all labels, you won’t be able to see the space in the space directory anymore. Just as a little remark.
You can read all about this subject right here in Atlassian’s documentation: