Yup it's mostly a mental game.
I was overweight for probably 75% of my life. My weight still fluctuates but I am well within "normal" range, and have been steadily lifting weights for about 2 years.
The first thing I would focus on is changing your mindset/relationship to food. This was the hardest thing for me to overcome personally. I used to use food as a way to compensate for feelings of loneliness, boredom, and general self-hate.
Figure out what is driving you eat with compulsion, and work on finding a way to replace eating with something else (take a walk, meditate, drink a glass of water, whatever it is).
Losing weight is just a numbers game. I honestly wouldn't even worry about being "fit" or hitting the gym regularly at this point. Work towards a healthy weight range and maintain it for a month or two, then slowly add in the exercise you want to. If you change everything at once you will become overwhelmed and throw everything away when it gets hard.
Good luck OP.