Autoremove unused dependencies and purge their configs (apt)
apt autoremove --purge
Removes packages that were automatically installed to satisfy dependencies and are no longer required, and with --purge also removes their configuration files; run apt clean afterward to clear cached package archives.