Here is a cheat sheet of how to choose a healthy protein bar:
Look for a bar with less than 5 grams of sugar (ideally 0-2 grams), and definitely do not grab a bar that has anything over 12 grams of sugar. Even if the label says something like "sweetened with dried fruit" or "natural sugars" bottom line is that sugar is sugar, certain types of sugar may be a little less bad for you, but sugar by any name is still not good for you.
Ideally there will be less than 10 grams of net carbs in the bar - lower the better. Net carbs are the carbs that impact your blood sugar, more sugar in your blood means greater insulin response, and greater insulin response means greater amount of sugar funneled into your fat cells (insulin is the fat storing hormone). You can calculate net carbs by subtracting the total fiber from the total carbohydrates listed. This is because your body does not process calories from fiber and they will not raise your blood sugar.
Look for a bar with plenty of protein because this is what is going to help to keep you full and help to keep your muscle mass. Protein is the hardest macronutrient for your body to breakdown, meaning it will take longer to be digested which will keep you fuller longer, AND you will burn calories just from the digestion of protein (because it takes energy to break it down). Aim for at least 15 grams of protein in the bar.
More fiber the better, this should be at least over 5 grams. As discussed above, fiber is not absorbed by the body but your body will still work very hard to try and break it down! This means digestion is slowed down when you eat fiber (keeping you fuller longer) and more calories lost from the energy your body puts in to trying to break down fiber.
Fat will help to keep you full and satisfied because it takes a longer time to digest and will not raise your blood sugar at all - meaning no insulin response, yay! It will also make the bar taste better - be weary of any "fat free" protein bar, this usually means there is added sugar to make it taste better. Aim for at least a couple grams of fat.
This might be the most important aspect of the protein bar because most bars are full of chemicals which can throw off hormones and may even cause you to gain weight. Ideally there will be under 10 ingredients on the list, you will be able to pronounce all of the ingredients, there will be no chemical names, and all ingredients will be from whole food source such as almonds or coconut.