If it’s not referenced and it’s in the store it can be collected via nix-collect-garbage. If it cannot then it is referenced and you need to remove what is referencing it. You can use a bunch of tools for this. nix-tree is quite useful for interactively tracing. nix-store --query is helpful if you want to script it (man nix-store-query).
nix store delete <path> (experimental interface) or nix-store --delete <path> (stable) will safely attempt to delete the path.
If it still has referents, it won’t be deleted.
But yes, rather than manually pruning paths, running GC would be better. You will also want to delete old profile generations eventually.