I'm sorry to hear your fish has died, it looks like it may have been fin rot, but there are many other illnesses that could have caused this such as columnaris and velvet too, these issues are nearly always caused by poor water quality, stress and or injuries to the fins allowing the bacteria to invade the tissues, I may be seeing things but is that not a worm ejecting itself from the fish at it's bottom?