I'm sorry your fish died. Sadly, he may well have had fin rot when you got him. It is not uncommon, can start with a nipped or injured fin. It can progress quickly, leading to loss of the fin, and if the rot reaches the body, the fish usually dies. They can regrow a fin, but it takes some time and super clean water.
I must ask, did you have a cycled tank to put the fish in ?
If not, then the water in your tank will have become toxic, which would have made things worse. Fish constantly produce waste, which is mostly ammonia. This is very toxic.
Cycling a tank grows special bacteria in the filter that digest ammonia and convert it, first to Nitrite, then to Nitrate, which is much less toxic. Then you do regular partial water changes to keep the amount of nitrate at moderate levels.
It can take many weeks to cycle a tank properly. I hope you had a cycled tank, but if not, you can always start to cycle one, see the Fishless cycle thread here, and start again.