Hi there congrats on your new boy

Bettas often go off their food for a week or so when you first get them, they just need time to settle in. They will taste things and spit them back out again, it's nothing to worry about. Just keep trying to feed him as usual and remove anything that he doesn't eat. As a rule for any fish, I always soak any type of pellet food in tank water (I use a shot glass) for about 15 mintues to soften it up and reduce the chance of problems with bloat.
Also, for the future, be sure and feed him a variety of foods. Maybe get him some flake food to alternate with. You could feed him (defrosted) frozen bloodworm once a week, deshelled and thawed peas once a week as well. It's just good to give them variety. Many betta keepers also don't feed their fish for one day a week to make sure thier system gets a change to clear out
