You can simply assign your products to the relevant category while adding a new product.
To create a new category while adding a product, go to Catalog ➤ Products, you will be redirected to the “Products” page. Now open the product in “Edit” mode or click the “Add Product” button. Now you are at the “Products Configurations” page and scroll down to the “Categories” field.
Now click on the “New Category” button and fill in the following fields.
Category Name: Enter the suitable name for the category.
Parent Category: Select the parent category for this product.
After filling all the fields click on the “Create Category” button to create a new category for your product.
After creating the category, it will be assigned in the Categories field. Now click on the “Save” button to save it in your store.