Service leftovers?

While installing some software (from dietpi-software to try it out) lately, I noticed that after uninstalling it there’s a couple of programs that I don’t remember being there, but at this point I’m not sure if I can uninstall it or not (this is, if any of my other programs need it).

For example, I installed Immich and even after uninstalling it, I noticed that there is postgres, redis, etc. programs installed that I suspect were related with Immich and I may no longer need it.

Is there any way to check if some service is needed by whatever service?

Thanks!