All the other posts are right-on.
I'd like to add if I may that although I'm definitely not the authority on losing weight, that I know from my personal experience that trying hundreds of diets would not guarantee weight loss, but a different lifestyle might. For me, that happened when I became a vegetarian.
I don't think being vegetarian was the "cure-all" but it made me more conscious of what I was putting into my body, which spurred (although I didn't realize it at the time), a whole lifestyle change.
The posts above definitely emphasize a lifestyle change, starting from finding a counselor or therapist you can talk to (since you mentioned you were feeling miserable, which makes me sad - so sorry to hear it!!) and other methods that help you gain back control over your eating habits, such as by letting you experience life again and not put your life on hold because of how you feel about your weight
I wish all the best to you on your journey <3
You look like a new member - stick around because this forum is a family; it really is