training wild sunfish to pellets:
the best way is to add the newly caught fish in with some fish already trained, they will usually eat pellets in less than 2 days.
if you don't have any pre-trained fish then you have to start from scratch
( for some reason the more fish you have the faster they will learn)
phase one (about a week)
I usually start training them on the second day of captivity. The idea is to get them to associate you with food. I have found that crickets work very well with larger (2" plus) sunfish. I will add few crickets several times a day for about a week (or until i run out of crickets) The movement of the crickets will trigger a feeding response in the fish. They soon associate any thing you put in the water with food and will grab for it. freeze dried shrimp have also worked well for me after the 3rd day or so.
phase two (about a week)
With hold food for a day or two (healthy fish can go up to three weeks with out food) then toss in some small pre-soaked pellets, they should strike the food and they usually spit it out. remove uneaten food after a while, keep this up several times a day until they eat the pellets. Usually one or two fish will start eating at this point and the rest are soon to follow. I would not let the fish go more than a week with out eating, not because it is that bad for them but you need to re-enforce the feeding response with your presence.
I have made an observation, use red colored pellets when training fish, for some reason they will take to them faster, i am not sure why. (perhaps they look like fish or frog eggs?)
With very small fish less than 1/2" it is best to have them in a smaller tank and to feed them frozen bloodworms, brine shrimp, mysis shrimp ect. I have had losses in the past feeding smaller fish the freeze dried variety of the above foods, until they gain enough size. (most sunfish will grow about 1" per month or so)