While all the above are nice suggestions, we also need to look at a few things:
1. What is the size of this tank? Over crowding can very much stress a betta so that he won't eat.
2. How many fish are in this tank? Some betta are overwhelmed after a certain number of tank mates.
3. What is the energy level of the other fish? Very fast and playful fish will definitely stress a betta.
4. Does the betta seem active outside of eating? If yes, then it could be that the crowd at the top of the tank stresses him (this happens with my females in the sorority tank).
Try soaking pellets in garlic. Seachem makes a product for this. Also, try frozen bloodworms, brine shrimp, or beef heart, as well as mosquito larvae. Avoid freeze dried foods as these lead to bloat, much like flake foods do. You may also feed smashed green peas (thawed in the case of frozen peas, as well as peeled of their skins).