Step 1: Make a vow that you wont eat unhealthy for a year til 1st June. In my case its til 2022 1st June.
Step 2: If you break the vow, you have to inflict a uncurable punishment. For me i promise i will chop off my right hand if i break it.
Step 3: Exceptions is allowed, like you can say "Exceptions is cake when family serves it" i have made a promise i wont eat cake or stuff during christmas this year as one exception rule. But think carefully before making the vow, because once made you cant break it or undo it.
Step 4: You can add more rules to the vow but not undo it. Example, i considered Pizza to be too much candy food, so i made a vow i will not eat it til 1st June has come. (Probably should have said cant eat pizza alone, but what the hey)
Step 5: Enjoy better life quality. Havent eaten unhealthy since then.
I think reason why "Promising yourself" doesnt work is because its so easy to break, because vague promises doesnt hold much up there.. But if your life feels at stake with a infliction.... then suddently its serious. So it helps if you are under lot of pressure and you dont know how to motivate or eat or live better.
Also my common rule is summer is the time of year when being stupid is totally fine.
But this helps any type of weight problems. Since weight tends to determine mobility and quality of life.