To craft a sorting wand:

S S X
S S X
X S X

To sort your own inventory use /sort

TODO: sort your hotbar separately