If one has a fish tank with many fish, and one of the fish happens to die on shabbas, can one remove the dead fish if the chances are significantly high that other fish in the tank will die because of the dead fish?
According to Rav Yehoshua Y. Neuwirth z"l, in his work Shemirath Shabbath [Ke'hilchata] (27:29):
a. A fish which has died may be removed from an aquarium, so that the other fish should not die, if a considerable financial loss is involved.
b. Taking out the dead fish is not a breach of the prohibition against selection, since the dead fish cannot be said to be mixed together with the live fish.
[If there is a dog or cat in the vicinity, the fish should be fed to them].
I note that the above answer seems to assume that leaving the dead fish in the fish tank will endanger the other fish. However this is questioned by some.
See discussion here: Are there health risks to leaving a dead fish in the aquarium?