Until you get a good quality pelleted food, feed him one flake. If he spits it out, remove flake from tank. Try again six or so hours later. Keep this up until he eats.
Do not offer him frozen bloodworms or freeze dried until he eats his pelleted/flaked food and then wait a month to do that. It's like giving kids desert after they've refused to eat their dinner. Bloodworms should only be given as treats and not be a Betta's staple diet.
You could also ask the place where you bought hiim what they fed. If it was frozen bloodworms, that's probably why he's not eating.
Survival is what an animal's world is all about. They won't starve themselves to death. It's a waiting game.