How to fight against Temptation?

Hello! I've been on myfitnesspal for a few weeks and I still have not reached my goal weight. I always end up gaining the weight I lost. I noticed I give into temptations. The food I usually give into is fast food. I get the smallest amount of food,however, I usually gain the weight back. I don't drink soda, and I'm a little bit nervous for the fall because I'm returning back to school full-time. I don't want to gain any more weight anymore.