It is quite common for newly purchased bettas to refuse to eat the food you give him. If the food you are giving is not the same as the shop, bettas often don't recognise it as food. The solution here is to keep offering a very small amount, and remove it if he doesn't eat it. Bettas do not starve themselves to death; sooner or later he will realise it is food.
I have had several bettas, one by one over the years. I have always fed betta pellets, starting with Hikari, then I moved on to Atisons, now I use Northfin. The majority of my bettas would only eat the pellets as soon as they were placed on the water; if one escaped and the betta found it later when it was soggy and waterlogged, they spat it out. But I've had one betta which would only eat soggy pellets. I had to soak them for several minutes, then carefully lay them on top of the water with a pipette.
If yours won't eat hard pellets, try soaking one and see if he'll eat that.