Loosing Weight

im
It has been a struggle for me to loose weight for the longest. The only time I was successfull was when I did this ridiculous diet where I avoided eating sugars, bread, pasta and rice and I dropped 5lbs in one week. This wasn't successfull, I relapsed and gained all the weight back and some. I'm only about 30lbs over weight and I want to loose 20lbs but the right way, does anyone have any good advice for weight loss?