How to sort by size of output by du -sh ~/* | sort -r
This worked.
du -sh ~/* | sort -rh

sort has -h flag:
-h, --human-numeric-sort, --sort=human-numeric
             Sort by numerical value, but take into account the SI suffix, if present.
...