It's normal for bettas to not eat the first few days. Don't worry...they can go for weeks without food

.
However, they will also stop eating if tank conditions are bad (like if there is ammonia present which may happen in a small tank) or if the temperature is too low. Remember that bettas are
tropical fish and need temperatures in the high 70's. Mine are kept at 78 degrees.
Also, it could be the food. Bettas often prefer pellets over flakes and sometimes have trouble eating large pellets (such as Wardley brand which I wouldn't recommend anyways).
HBH Betta Bites and Hikari Betta Bio-Gold are commonly found brands that tend to be loved by bettas. I also feed mine a variety of frozen foods...bloodworms, brine shrimp, mysis shrimp, krill, etc.