I had the same problem once...
Betta fish are really picky eaters, and most pet shops
"feed" them pellets or flakes. Truth is these fish rarely
eat these foods and will only do so if they're desperate; they can
be trained to but why waste your time when you can give them
something they'll eat right away? Try to buy live foods, if you
can't look around for some freeze-dried versions, you can also feed
your Betta ants (and their eggs) and house flies.
You can try soaking the pellets before you put them in the tank for
feeding. You could also try flakes that float, or blood worms but
don't overfeed on blood worms though, it'll make him to FAT. They
love blood worms!
Try giving your Betta another type of food. They hate eating flakes
and sometimes pellets. Other brands of pellets might work. Betta's
love frozen, or better yet, freeze-dried, food like blood worms or
plankton. Or if you can't get your Betta anything else, try
skipping his feeding for two, only two days, and he'll be so hungry
he'll be able to eat his nasty food even if he's picky.
Blood worms are definitely the most efficient and reliable way to
feed your Betta. The little pellets are fine but soon, the fish
will get sick of eating them.