Another good question. I'm paraphrasing here, it was something like, "How do you know you're fixing the right problem if things seem wrong? In relation to habit change, improvement, changing moods - how do you know you're solving the right thing?"
My answer -
Well, I think the first thing worth saying is that most people don't fix most of their problems. I don't say that as a pessimist - they could fix their problems. But they don't. Most people don't change much after their early youth is over. If they overeat, they overeat their whole life. If they're an alcoholic, they're an alcoholic their whole life. If they work at some shitty job they hate, they work there their whole life.
I say this just to give you an idea of how hard it can be. In my experience, it takes me a lot longer than I want it to to change fundamental aspects of my character and habits. Oftentimes, it takes 6+ months of regular focus on it, if the old habit was burned in a lot. That sucks and it's hard, which is why most people don't change.
I think fundamentals are typically the way forwards. When feeling low, unproductive, frustrated, annoyed, angry, whatever - typically, the answer is fundamental stuff. Eat right, stretch, breathe, get into motion with some exercise or at least some walking, spend time in nature, spend time around people you respect, read good books, get on a normal healthy sleep schedule, take vitamins, clean up the area around you, things like that. Wash all the clothing, clean up computer/email files, shave (for a guy)/cut fingernails/cut toenails. If in a country where it's inexpensive, go get a massage. Go sit in a quiet cafe or on a beach and fully relax if very tired. Do planning/goal-setting type stuff in a notebook.
I find it's very, very hard for me to do correct things for 3 days in a row and still be in a bad mood. If I'm stretching, exercising, taking vitamins, sleeping on a good schedule, eating well, spending time in nature, breathing, planning/strategizing, reading good books, connecting with good people, improving the environment and things around me...
You might wind up solving the "wrong" problem like you say, but it's still worthwhile. And there's a very good chance that if you work on 5-10 fundamental areas, you'll hit on the real problem and solve it.
As for long term habit change, it's harder than most people anticipate, which is why most people quit. My biggest advice there is to just stick with it and constantly pay attention to it if you do think it's important. I've got habits that have taken me months to establish, or even a couple years sometimes, but I think it's worthwhile and worth doing.
I wish there was a more fancy epiphany-generating answer, but I'm not sure there is. I think it's really fundamentals + paying attention to what's important, and then constantly refocusing your attention on things that are important. I think that solves the vast majority of problems, habit change, etc.