...
In the LayerTree header you will find some icons (top right), one of these is a delete icon represented by the trash bin as highlighted below.
Clicking on it enables the delete mode after which the user can delete folders and layers from the LayerTree by clicking on the icon. The items in the LayerTree will be highlighted (in red) on hover.
To disable the delete mode click on the trash bin icon again.
...