He died today

but I was feeding zuhnini , spirallina atlas wafers and hikari and ner era rift lake recommended by bregun never really saw him eat, what can I do next time to prevent this
hi, sorry for your loss.
You asked how to prevent this in future, so there are some things members will need to know before you can get any kind of answer.
Firstly, when you bought him, did you chcek his tummy? It should never be sunken in as by that time it is too late , even if they want to eat , they can't. So before purchase , check them out good, and ask what the store has been feeding it.
In this situation, it is very important to include eveything about the tank and the tankmates.
Water parameters ?
What kind of filter system?
What size tank and how long running ?
Tankmates?
How long did you have this one before it's demise ? Did you EVER see it eat ?
Tank cleaning routine, wc's , vacuums, etc, how often.
Do you use water conditioner ie Prime or other to neutralize the chlorine and chlorimides ?
Did you read up on the needs of your fish before purchase ? ie ph needs etc. ?
So if you want members to try to answer why this happened, please give as much info as you can so members have some idea what could have happened.
If you never saw him eat, and his tummy and eyes were sunken when you purchased him, my bet was he was already too far gone, but I am not an expert here ,so see what others think once you give the info above. They may have other ideas . HTH