First it is good to note that categories will always appear before the products on the site page.
The categories can be sorted/ordered by going to Site Name > Catalog > Catalog Organization.
The categories on your site will be shown in a tree view on the right side of the screen. To sort the order of the categories, you can click the category and drag the category to adjust the sort order.
To sort the order of products within a category, you must first select the category you wish to see products for. Once you choose a category, products within the category will be shown in the lower right side of the screen. Click and drag the product by the icon with three horizontal lines to adjust the sort order of the products.
Please see the screenshot below: