pamac commands do not need sudo
guessing there is also a command to purge/autoclean not needed software
From Manjaro Wiki:
Dealing with Orphaned Packages
To remove all orphans use the command:
pamac remove -o
to remove all packages except for the latest three package versions using:
pamac clean --keep 3
See also - Maclean - a small script to automate (safe) cleaning functions