Better to buy small tank, 10 gallons. Then you can keep good filter and lots of plants in your tank. Male betta need warm water, so you need heater too.
It will probably eat evertyhing you give him, worms, insects, flakes other than bettas food... But don't buy food that sinks, it doesn't eat from bottom.
If you buy small tank, 10 gal, you can put couple kuhlii loaches in your tank too..