Sometimes bearded dragons go through a "fast" and don't eat much. What you have to look out for is whether he's lethargic, dull in color, and losing weight. If any of these things are happening in addition to him not eating, you need to worry.
First, how long has he not been eating? 2-3 days can be normal is he's still running around and alert. If it has been longer than that, the first thing you want to do is make sure you get some fluids into him. These guys dehydrate pretty quick when sick. I would suggest buying some chicken baby food and mixing it up with some pedialyte until the texture is very liquidy and feeding it to him through a dropper. Let him eat as much as he likes. If he refuses to drink, you'll have to force his mouth open to do so. Don't get offended if he bites...that's a good sign. I like the chiken baby food/pedialyte mix because it also help get some nutrition into him as well. But, you can also try diluted gatorade. My dragons seem to like the Fruit Punch and Kiwi-Strwaberry flavor the best. I would try to give him fluids at least 2-3 times daily.
Another reason for not eating is parasites. Whether he has them or not, you can safely treat for it right now using Parazap. I usually use the "tea-method" to get it into my dragons' system. What you do is boil some water and mix about a 1/2 teaspoon to 1/4-cup of water. Try to get your dragon to drink as much as he'll take for 7 days. It'll get rid of any parasites and also works as an appetite stimulant. So you might get him to eat just doing this.
If you find that his condition is deteriorating rapidly. I would take him to the vet ASAP.
Hope this helps and good luck! ~Xenia