I agree with the starving method but thought I might add a bit more to it.
I have found it better to feed what the fish like for a few days, making sure to stuff them up really good. After a few days of power feeding what they like, make sure to cut them off for 3 or 4 days before offering the pellet or whatever food you want them to eat.
I have found that just like humans, fish have a metabolism that can be adjusted. If you feed a fish large amounts of food for a while and starve them they will be much hungrier than if the fish only ate 3 small meals per week and suddenly stopped eating.
I have found this to work very well and only requires about a weeks time to get them on the pellet. The real challenge comes when you have a fish that doesn't eat anything