need to stay motivated

I am so bad at staying on a diet. Right now though I am at my highest weight ever and my body is suffering in so many ways. One of my biggest downfalls is that I crave sugar like no tomorrow.:grumble: I am 5ft 5 inches and weigh 237. My ankles are taking the worst of it right now. I have been going to the gym and somehow managed to injure my foot. From what I can figure out by googling it is a common injury suffered by runners. A type of sprain right under my ankle that hurts when I bare weight. I am open to any suggestions to help me get on track