Categories are not listing their respective products

Normally, while creating a store, you’d go with the third choice, items and categories/subcategories. This means that users can either choose products directly from the main page or refine their search by going to a product category archive.

This tutorial will teach you how to show categories in a separate list before showing items.

Distinguish the WooCommerce code that is used to display categories and subcategories on archive pages.
Make a code plugin.
Create a function that places categories or subcategories before of product listings.
Customize the output
Navigate to WooCommerce > Settings, then to the Products tab, and finally to the Display option. Select Show both for each of the Shop Page Display and Default Category Display choices.

WooCommerce Product Category Display
To save your changes, click the Save changes button.