There are a couple of ways to remove packages. When you remove packages, you merely remove the packages - but not their configuration files. Used alone, the following command removes a package in a terminal window.
sudo apt-get remove [x]
When we purge a package, we remove the packages and all of its configuration files. The command below purges a package in our terminal window.
sudo apt-get purge [x]
After a purge, you would generally execute
sudo apt-get autoremove
I gave you a combo command, for convenience earlier - it works fine too.