Most personal trainers are good at overall health, routines and motivation. However, when it comes to diet, there are limitations to the amount of knowledge a personal trainer has. In my experience as a personal fitness trainer, I am comfortable with giving general guidelines as to how many calories one should eat if they want to lose/gain weight. Also, I like calorie counting apps like MyFitnessPal which does the calculations for you based on some basic information you provide.
However, if you are suffering from diabetes, or have thyroid issues, or gout, you would be better served seeking the expert advice of a registered dietician. Anyone, even your dog, can be a nutritionist, but a dietician has a degree and is well-schooled in how to safely eat for weight loss or gain with lasting changes.