To add categories to a segment, click on the Add Contents button.

Click on the categories option

Choose the categories from the list and add them to your segment.

To create a new category, please check the How to create categories article to know more.
After clicking on save changes the new category will be added to your segment

Note :
Adding the category will not add all the products within it to the segments. You need to add the required products within the segment or sub-segment.
A category within the segment will show the intersection of products added in segment/sub-segment and category. When students click on the category within a segment, they will see only those courses which are commonly added in segment & category.

-2.png)
Conclusion
Do check out these support articles related to segments: