How interesting to read, i am so glad you posted this. I saw it a few days ago, but was really busy, and had to go to work. So, i'm really sorry for my late reply
Man! you just described the story of my life. I have the exact same thoughts about food as you (among other things).
I used to weight 12 kg more than i do now, and one of my main obstacles was my obsession with one particular grocery at a time. The item would vary over time, but always center around one thing as you described. I wen't to bed like you and would keep visualizing for example a slice of bread with butter cheese and cucumber (it was very specific) and i would go into a semi-sleep where i would think so hard about this one thing, that i would wake up exhausted and with a headache of another dimension, due to tensions in my head.
I'm sorry to say that there is no easy way out of it, it takes a lot of time and practice, but you can try though, but you will have to really put your heart into it, otherwise it won't work. For example, did you know that your mind don't the word "not". So if you're thinking "I can not have cookies", something gets lost in translations between you and neurons, and it will translate into "I can have cookies". So what you need to do it get away from it completely. Not allow yourself to think about cookies at all or other dieting things. For example start to reason with yourself "I don't want these cookies because i want to look hot in a bikini"
You should just "walk away". For example go for a run, jog. Whenever food pops into your mind, make sure that it's not because your hungry, and make sure that your blood sugar is okay. You should not eat ANY sugar during a normal day, because your body will fysiologically crave it, and make it harder for you to mentally fight your thoughts. I have a rule that says that i can have something with sugar, on weekends.
And then you should structure your day, so that the "fight" doesn't become endless. Eat every 2 hours (i did that in the beginning, because then i only had to fight thoughts, all OCD thought, not just food-thoughts, for 2 hours at a time. You can do that). So for 2 hours you need to keep busy. Mayeb you go to school? or work? So the real fight is perhaps really when you get off and til you go to bed. A fight always becomes easier if its not too boring. So maybe you like to go shopping, or if you're dirt-poor like me, go try on clothes but not really buy anything, and dream about all the things you can't afford. Just do something you enjoy.
That is my advice
Distraction, keep busy, never go hungry, and make yourself comfortable, so that it can become a lifestyle.
Also, you need to make room for the world outside. Perhaps you know that you have to attend a party where you will be offered sweets or anything with lots of calories the following weekend. Say to yourself that you look forward to this, and you can eat all the sweet you want there, and never say to yourself that you CAN NOT have sweets during the week, but just elegantly and smoothly "forget" to buy any. Trick yourself
Tell me if you think it sounds completely mental. Afterall, i really also am an OCD'er at heart, and nothing can seem more insane than that at times, right?
on a more serious note. I do hope that you're alright.
Take care, i hope to hear from you