How can I motivate myself to keep dieting?

Sadly. the best motivator is having bad consequences such as diabetes, heart disease, etc. Or.... visualizing the very real consequences of elevated weight versus the good consequences of not overeating.
Diet > lifestyle. Presumably u r female, and have been on a dozen diets, have regained the weight each time. Make a promise to yourself: when you achieve a realistic goal, eg size 12 to size 8, you r going to like yourself, u r going to stay in control of what you put in your mouth, u will not allow emotions to control your behavior. Luv yourself, baby!