I had a fish that would do this in quarantine after buying, the poor oranda had eaten nothing but flakes for several days, so when I started keeping him on a diet of tubifex and peas he was getting better

Other than that, we need to know your tank size and maintenance schedule, like cheri said
