The new Stacks feature of macOS Mojave organizes messy desktops by automatically stacking files into neat groups. It collects the files on your desktop and groups them into neat little stacks along the right edge of your Mac’s screen. Toggling Stacks on and off is done with clicks on the desktop. When at the desktop, right click, then choose the "Stacks" option. Right click, you say? Yep.
You can either hold down the "Ctrl" button while clicking your Mac’s mouse or tap the trackpad with two fingers. The latter option needs to be activated in the Keyboard and Mouse section of System Preferences. Under the Trackpad tab select "Tap trackpad using two fingers for secondary click".
You can also use the Finder to enable Stacks.
Open a Finder window.
In the menu bar at the left top side of the Mac’s screen, choose View.
Check the "Use Stacks" option. Click it again to “unstack” your desktop items.
Turning on Stacks will automatically organize your files by file type. By default, Stacks organizes your files by file type (which MacOS calls "Kind.") This puts your Word docs in one pile, images in another, PDFs in their own stack, etc.
However, you can sort stacks differently if you wish. Right-click on your desktop, mouse over Group Stacks By and you can select Date Last Modified, Date Added, Date Modified, Date Created and Tags.