Align the selected layer(s)/group(s) to the respective side.
Align the selected layer(s)/group(s) to the next guide on the respective side.
If you hold down the Alt/Option key, the selected layer(s)/group(s) will be duplicated before moving.
If you hold down the Ctrl/Command key, the existing selection (if any) will be aligned.
If you hold down the Shift key, the existing selection (if any) will be deselected after aligning.
A right-click on a button shows you all available functions, so you don't have to remember the keyboard shortcuts.