They’re both correct, but not quite equivalent.
apt purge --auto-remove
purges `packagename` and any packages which are rendered unnecessary by its removal, as well as any other packages which aren’t necessary.
apt autoremove --purge
purges any packages which aren’t necessary (marked as “automatically installed” and with no dependent packages).
The first form is what you’d use when manipulating individual packages; the latter is a clean-up operation across all packages.
You could also enable `APT::Get::AutomaticRemove` in your `apt` configuration to get `apt` to always auto-remove (or use `aptitude` which behaves like that by default).