After a new installation of Debian, I'm looking for a way to separate files created from new packages from my main system. I want to do this to avoid bloating the size of my drive with unnecessary libraries or packages and would prefer the files be in a different drive or folder that can be deleted or used to monitor what packages should be removed.
Specific example: I've installed the cairo library so that I can compile a certain application. Suppose I later decide to uninstall this application. From my understanding, I think that just uninstalling the application will not remove the program entirely because the package manager will still keep the required library because I asked for it to be installed explicitly instead of automatically installed as part of a package dependency. How will I remember to remove this associated library? I want to do this for 10 applications at once.
I also sometimes manually install packages to try and fix certain problems or add features to an application but later find out that the installation was not actually what I wanted, and I can later forget that I've installed it. How can I detect that a package I manually installed is not actually being used by me?
I'm asking this because on my last installation of Debian, my root partition became a little bloated and I wasn't able to figure out why. It was about about 3 times the size of mt root partition now. This question is based on inference, and what I've read about how Debians package management works. Please correct any confusion.