Finder by default lists directory contents alphabetically regardless of whether it is a file or a folder. This could be confusing for some especially if you're coming from Windows or Linux environment where folder is listed first before files.
Finder can however be configured to list folder first from its preferences options.
Steps to sort folder first for Finder in macOS:
Open
Finder preferences from the menu.

Click on the the
Advanced tab.
Check the
Keep folders on top when sorting by name box.
Finder will now lists folders before files.
Author:
Mohd Shakir Zakaria Cloud architect by profession but always consider himself as a developer, entrepreneur and an opensource enthusiast.
Discuss the article:
Comment anonymously. Login not required.