You can build from source, install from install script, install with snap, flatpak, or appimage, you can cp or mv binary files, etc...
All of those have very, very different ways to remove them. Some will even need to be removed manually because the author only wrote an install.sh and the uninstall.sh just simply doesn't exist.
So, there are all sorts of ways - and it depends on how you installed stuff.
I realized my answer sounded unintentionally flippant. Don't get me wrong, I'm sometimes flippant! This was just unintentionally so. Or that's how it could have been interpreted. So, I figured I'd elaborate.
It's Linux, there's always multiple ways to do something.
Edit: Here's an answer where I helped someone remove MySQL from their system:
I want to completely remove MySQL from my system, including databases, settings, logs, journals, etc. How can I do it? Update/Note: The MySQL was installed using the following terminal commands: su...