You are lucky in several respects. You are still young and so your body responds well to changes in diet and activity. Believe me, as you get older it becomes more difficult to shed the unwanted weight. I sense that you would like to lose those 50 pounds you've put on. I cannot recommend any particular diet or exercise regimen. What I can do is tell you that it is a matter of personal discipline and finding what works for you. You know what healthy foods you should eat. You know that moderate exercise will raise your metabolism and burn off some of the excess. These messages have been drilled into us by the "fitness culture" we currently live in.
I also want you to understand is that a positive outlook is every bit as important as the diet and exercise. Don't punish yourself if you indulge once in a while. If you make yourself miserable trying to reach your desired goal, then you will resent the process and fight it every step of the way. Patience is also important. You say you put on 50 pounds over two years. Those 50 pounds will not come off overnight. The biggest reasons people try diet after diet losing and gaining the same ten to twenty pounds over and over is because they don't enjoy the regimen and so they cannot wait to get it over with. That is, they are unhappy with the process and have no patience to see it through. Another big problem is that many of the "lose 30 pounds in 30 days" type programs are just what they say, short term quick fixes. They are also often unhealthy. They rarely address real life behaviors and habits.
There you have it, my friend. You can overcome this challenge in your life. I have faith in you.