Are you aware of what attractiveness and ugliness means? Essentially, it means that you have a quality that you like in the first case and a quality that you dislike in the second case. That doesn't look too new I know, but it is. If it depends on you to like or dislike, the thing itself is not inherently bad or good, it just is. You know, like an apple or a pillow. They are just them.
As you see, the problem is not that you are fat, is what you choose to think when looking at your fat. With that said, lets answer you question. You lose weight by eating better and exercising. Duh, right? Well, that's what it is, our weight is literally made of the ratio between the calories we take in and the calories we take out. Don't worry about starving though, by eating unprocessed food only you will never feel any big urge to eat stuff, so you should never get fat. The attractive deal you make happen by changing your mindset. Why? No matter what you do, if you have a mind that finds reasons to
Dislike matter, then you'll always find a reason to dislike yourself. Once you get slim, it may be your teeth. If not them, your skin color, or nose, or eyes, or too big or too small of a hand, or your lack of intelligence, or your lack of courage, the list just goes on indefinitely and you'll never be pleased with yourself. So focus on accepting the true nature of things, without adding your self-made prejudice. You can check some guided meditations online to help with that. Good luck :)