So now you're bringing depression into this? Move goalposts much?Can you learn to stop suffering from depression?
To answer your question, I don't think a mindset change is enough in isolation for most who suffer from depression, especially if there is a genetic and/or chemical component to it. I do think there is a "skill" to happiness in terms of having a better mindset where you appreciate what you have and seeking contentment instead of fleeting emotions of "happiness". Although that is part of a broader strategy that also includes a combination of lifestyle change, counseling, exercise, and/or medication. Some psychologists now consider exercise to be one of the crucial legs of the stool for depression.
For weight loss, transitioning away from processed and restaurant foods into whole foods is not easy, but doable for most and will get results. It does take work, just like almost everything else worthwhile in life.