I am not big on dieting, but I can share with how I "behave" in regards to my eating. If you're looking to have ripped abs and sub 10% body fat then disregard what I am about to say. If you just want to be strong, healthy, and athletic-- this could be useful advice.
In regards to mental illness, it depends. Are you counting your stuff because you're prepping for a show? Are you doing it to find a baseline of nutrition for yourself? Are you trying to find structure and learn about food and your own dietary habits?
So, in some instances, it can be very beneficial to calorie count or count your macro nutrients-- or even micro nutrients. However, for literally 95% of people at some point, I don't think they need to do that at all. Starting out I think using something like the app MyFitnessPal can be very useful for someone who has no idea how much they are consuming or what they are consuming. I think by them logging their food for several months can teach them a lot about what is in food and what they are consuming.
In my opinion though, the ultimate goal should be to get to where you can eat and get through every day without having to think about it. You should just know eventually, because you have educated yourself on food and your own dietary needs. For myself, I can visually notice, use a scale, and notice by how I feel on what I need to eat and how much I need to eat. But that has come from years of "paying attention" to my own body and how it behaves to food, stress, and training.
I have a lot of favor towards Jim Wendler's attitude on diet, I would suggest you check it out if you're not familiar. As you may know, he was a forum on here, his own website, and has written tons of useful stuff on the matter.